function populateUserInfo(user) {

  if (!user)
    return; // Permissions at default (false)

  // For now, only the user may edit metadata like bio.
  // In future, translators may also be able to.
  if (user.id == this.id)
    this.userCanEditMetadata = true;
}
/**
 * Determine what the provided user (typically the currently logged in user)
 * may do with the data associated with this User object, and populate its
 * permission fields accordingly.
 *
 * @param {User} user
 *  user whose permissions on this User object we want to determine
 * @memberof User
 * @instance
 */
Determine what the provided user (typically the currently logged in user)
may do with the data associated with this User object, and populate its
permission fields accordingly.

@param {User} user
user whose permissions on this User object we want to determine
@memberof User
@instance
Determine what the provided user ( typically the currently logged in user ) may do with the data associated with this User object and populate its permission fields accordingly . @param { User } user user whose permissions on this User object we want to determine @memberof User @instance
function populateUserInfo(user) {
  if (!user)
    return; 
  if (user.id == this.id)
    this.userCanEditMetadata = true;
}
function populateUserInfo ( user ) { if ( ! user ) return ; if ( user . id == this . id ) this . userCanEditMetadata = true ; }
Determine what the provided user (typically the currently logged in user)
 may do with the data associated with this User object, and populate its
 permission fields accordingly.
Determine what the provided user ( typically the currently logged in user ) may do with the data associated with this User object and populate its permission fields accordingly .
// Permissions at default (false) // For now, only the user may edit metadata like bio. // In future, translators may also be able to.