code: public synchronized boolean hasAccess(String queueName, JobInProgress job, 
                                  QueueOperation oper, 
                                  UserGroupInformation ugi) {
      if (!aclsEnabled) {
        return true;
      }
      
      if (LOG.isDebugEnabled()) {
        LOG.debug("checking access for : " + toFullPropertyName(queueName, 
                                              oper.getAclName()));      
      }
      
      if (oper.isJobOwnerAllowed()) {
        if (job != null && job.getJobConf().getUser().equals(ugi.getUserName())) {
          return true;
        }
      }
      
      AccessControlList acl = aclsMap.get(toFullPropertyName(queueName, oper.getAclName()));
      if (acl == null) {
        return false;
      }
      
      // Check the ACL list
      boolean allowed = acl.allAllowed();
      if (!allowed) {
        // Check the allowed users list
        if (acl.getUsers().contains(ugi.getUserName())) {
          allowed = true;
        } else {
          // Check the allowed groups list
          Set<String> allowedGroups = acl.getGroups();
          for (String group : ugi.getGroupNames()) {
            if (allowedGroups.contains(group)) {
              allowed = true;
              break;
            }
          }
        }
      }
      
      return allowed;    
    }
docs: Return true if the given {@link QueueManager.QueueOperation} can be
  performed by the specified user on the specified job in the given queue.
  
  An operation is allowed either if the owner of the job is the user
  performing the task, all users are provided access for this
  operation, or if either the user or any of the groups specified is
  provided access.
  
  If the {@link QueueManager.QueueOperation} is not job specific then the
  job parameter is ignored.
  
  @param queueName Queue on which the operation needs to be performed.
  @param job The {@link JobInProgress} on which the operation is being
  performed.
  @param oper The operation to perform
  @param ugi The user and groups who wish to perform the operation.
  
  @return true if the operation is allowed, false otherwise.