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

@param {Object} work

@returns {Boolean}
@method isUsersWork @description query the work object sent in params and send it into getAuthors function determine if the user ' s work is within the array returned . @param { Object } work @returns { Boolean }
isUsersWork(work) {
    if( !config.user ) return false;
    if( !config.user.expertsId ) return false;
    try {
      let workAuthors = this.getAuthors(work);
      for( let type in workAuthors ) {
        let authors = workAuthors[type];
        for (let author of authors) {
          let authorId = author['@id'].replace(this.service.jsonContext + ":", "");
          if (config.user.expertsId === authorId.toLowerCase()) {
            return true;
          }
        }
      }
    } catch (error) {
      console.error('Error checking isUsersWork', error);
    }
    return false;
  }
isUsersWork ( work ) { if ( ! config . user ) return false ; if ( ! config . user . expertsId ) return false ; try { let workAuthors = this . getAuthors ( work ) ; for ( let type in workAuthors ) { let authors = workAuthors [ type ] ; for ( let author of authors ) { let authorId = author [ '@id' ] . replace ( this . service . jsonContext + ":" , "" ) ; if ( config . user . expertsId === authorId . toLowerCase ( ) ) { return true ; } } } } catch ( error ) { console . error ( 'Error checking isUsersWork' , error ) ; } return false ; }
@method isUsersWork
 @description query the work object sent in params and
 send it into getAuthors function determine if the user's
 work is within the array returned.
@method isUsersWork @description query the work object sent in params and send it into getAuthors function determine if the user ' s work is within the array returned .