function populateUserInfo(user) {

  if (!user) // Keep at permissions at default (false)
    return;

  if (user.isSuperUser || user.id === this.createdBy)
    this.userCanEdit = true;

  if (user.isSuperUser || user.id === this.createdBy || user.isSiteModerator)
    this.userCanDelete = true;
}
/**
 * Populate virtual permission fields for this post based on a given user
 *
 * @param {User} user
 *  the user whose permissions to check
 * @instance
 * @memberof BlogPost
 */
Populate virtual permission fields for this post based on a given user
@param {User} user
the user whose permissions to check
@instance
@memberof BlogPost
Populate virtual permission fields for this post based on a given user @param { User } user the user whose permissions to check @instance @memberof BlogPost
function populateUserInfo(user) {
  if (!user) 
    return;
  if (user.isSuperUser || user.id === this.createdBy)
    this.userCanEdit = true;
  if (user.isSuperUser || user.id === this.createdBy || user.isSiteModerator)
    this.userCanDelete = true;
}
function populateUserInfo ( user ) { if ( ! user ) return ; if ( user . isSuperUser || user . id === this . createdBy ) this . userCanEdit = true ; if ( user . isSuperUser || user . id === this . createdBy || user . isSiteModerator ) this . userCanDelete = true ; }
Populate virtual permission fields for this post based on a given user
 @param {User} user
  the user whose permissions to check
 @instance
 @memberof BlogPost
Populate virtual permission fields for this post based on a given user @param { User } user the user whose permissions to check @instance @memberof BlogPost
// Keep at permissions at default (false)