client/public/src/models/GrantModel.js
/**
   * @method isUsersWork
   * @description query the grant object sent in params and 
   * send it into getAuthors function determine if the user's 
   * grant is within the array returned. 
   * 
   * @param {Object} grant
   * 
   * @returns {Boolean}
   */
@method isUsersWork
@description query the grant object sent in params and
send it into getAuthors function determine if the user's
grant is within the array returned.

@param {Object} grant

@returns {Boolean}
@method isUsersWork @description query the grant object sent in params and send it into getAuthors function determine if the user ' s grant is within the array returned . @param { Object } grant @returns { Boolean }
isUsersWork(grant) {
    if( !config.user ) return false;
    if( !config.user.username ) return false;
    try {
      let contributors = this.getContributors(grant);
      for (let grantContribute of contributors) {
        let contributorId = grantContribute['@id'].replace(this.service.jsonContext + ":", "");
        if (config.user.username.toLowerCase().split('@')[0] === contributorId.toLowerCase()) {
          return true;
        }
      }
    } catch (error) {
      console.error('Error checking isUsersWork', error);
    }
    return false;
  }
isUsersWork ( grant ) { if ( ! config . user ) return false ; if ( ! config . user . username ) return false ; try { let contributors = this . getContributors ( grant ) ; for ( let grantContribute of contributors ) { let contributorId = grantContribute [ '@id' ] . replace ( this . service . jsonContext + ":" , "" ) ; if ( config . user . username . toLowerCase ( ) . split ( '@' ) [ 0 ] === contributorId . toLowerCase ( ) ) { return true ; } } } catch ( error ) { console . error ( 'Error checking isUsersWork' , error ) ; } return false ; }
@method isUsersWork
 @description query the grant object sent in params and
 send it into getAuthors function determine if the user's
 grant is within the array returned.
@method isUsersWork @description query the grant object sent in params and send it into getAuthors function determine if the user ' s grant is within the array returned .
// for (let id of author.identifiers) { // }