viewer/vueapp/src/components/users/UserService.js
/**
   * Determines whether a user has permission to perform a specific task
   * @param {string} priv The privilege in question. Values include:
   *                      'emailSearch', 'enabled', 'packetSearch',
   *                      'headerAuthEnabled', 'removeEnabled', 'webEnabled',
   *                      '!hideStats', '!hideFiles', '!hidePcap', '!disablePcapDownload'
   * @returns {boolean}   true if all permissions are included.
   */
Determines whether a user has permission to perform a specific task
@param {string} priv The privilege in question.
Determines whether a user has permission to perform a specific task @param { string } priv The privilege in question .
hasPermission (priv) {
    const user = store.state.user;
    if (!user) { return false; }
    const privs = priv.split(',');
    for (let p of privs) {
      let reverse = false;
      if (p.startsWith('!')) {
        reverse = true;
        p = p.substr(1);
      }
      if ((!reverse && !user[p]) ||
        (reverse && user[p])) {
        return false;
      }
    }
    return true;
  }
hasPermission ( priv ) { const user = store . state . user ; if ( ! user ) { return false ; } const privs = priv . split ( ',' ) ; for ( let p of privs ) { let reverse = false ; if ( p . startsWith ( '!' ) ) { reverse = true ; p = p . substr ( 1 ) ; } if ( ( ! reverse && ! user [ p ] ) || ( reverse && user [ p ] ) ) { return false ; } } return true ; }
Determines whether a user has permission to perform a specific task
 @param {string} priv The privilege in question.
Determines whether a user has permission to perform a specific task @param { string } priv The privilege in question .