function populateUserInfo(user) {
  if (!user)
    return; // fields will be at their default value (false)

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

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

  if (user.id === this.createdBy)
    this.userIsAuthor = true;
}
/**
 * Populate virtual fields with permissions for a given user
 *
 * @param {User} user
 *  the user whose permissions to check
 * @memberof Review
 * @instance
 */
Populate virtual fields with permissions for a given user
@param {User} user
the user whose permissions to check
@memberof Review
@instance
Populate virtual fields with permissions for a given user @param { User } user the user whose permissions to check @memberof Review @instance
function populateUserInfo(user) {
  if (!user)
    return; 
  if (user.isSuperUser || user.isSiteModerator || user.id === this.createdBy)
    this.userCanDelete = true;
  if (user.isSuperUser || user.id === this.createdBy)
    this.userCanEdit = true;
  if (user.id === this.createdBy)
    this.userIsAuthor = true;
}
function populateUserInfo ( user ) { if ( ! user ) return ; if ( user . isSuperUser || user . isSiteModerator || user . id === this . createdBy ) this . userCanDelete = true ; if ( user . isSuperUser || user . id === this . createdBy ) this . userCanEdit = true ; if ( user . id === this . createdBy ) this . userIsAuthor = true ; }
Populate virtual fields with permissions for a given user
 @param {User} user
  the user whose permissions to check
 @memberof Review
 @instance
Populate virtual fields with permissions for a given user @param { User } user the user whose permissions to check @memberof Review @instance
// fields will be at their default value (false)