code: function roleDFSOnePrivilege(role, resource, privilege) {
          resource = typeof resource === 'undefined' ? null : resource;
          privilege = typeof privilege === 'undefined' ? null : privilege;
  
          if (null === privilege) {
              throw new Error('$privilege parameter may not be null');
          }
  
          var dfs = {
                  visited: {},
                  stack: []
              }, result;
  
          if (null !== (result = roleDFSVisitOnePrivilege(role, resource, privilege, dfs))) {
              return result;
          }
  
          // This comment is needed due to a strange php-cs-fixer bug
          while (null !== (role = array_pop(dfs.stack))) {
              if (dfs.visited[role] === undefined) {
                  if (null !== (result = roleDFSVisitOnePrivilege(role, resource, privilege, dfs))) {
                      return result;
                  }
              }
          }
  
          return null;
      }
docs: Performs a depth-first search of the Role DAG, starting at $role, in order to find a rule
  allowing/denying $role access to a $privilege upon $resource
  
  This method returns true if a rule is found and allows access. If a rule exists and denies access,
  then this method returns false. If no applicable rule is found, then this method returns null.
  
  @param {string} role
  @param {string} [resource=null]
  @param {string} [privilege=null]
  @return {(boolean|null)}