code: private boolean isSubjectAuthorized(String resourceName,
                                          Collection<String> requiredRoles, Subject subject) {
  
          AccessDecisionService accessDecisionService = accessDecisionServiceRef.getService();
  
          // check user access first
          boolean isGranted = false;
          WSCredential wsCred = getWSCredentialFromSubject(subject);
          String accessId = getAccessId(wsCred);
  
  //        if (useRoleAsGroupName && !isAuthzInfoAvailableForApp(resourceName) && !resourceName.equalsIgnoreCase(ADMIN_RESOURCE_NAME)) {
          if (useRoleAsGroupName && !isAuthzInfoAvailableForApp(resourceName)) {
              isGranted = useRoleAsGroupNameForAccessDecision(resourceName, requiredRoles, subject, accessDecisionService, wsCred);
          } else {
              isGranted = useAppBndForAccessDecision(resourceName, requiredRoles, subject, accessDecisionService, wsCred, accessId);
          }
  
          return isGranted;
      }
docs: Check if the Subject is authorized to the required roles for a given
  resource. The user is checked first, and if it's not authorized, then
  each group is checked.
  
  @param resourceName
  the name of the application, used for looking up the correct
  authorization table
  @param requiredRoles
  the roles required to access the resource
  @param subject
  the subject to authorize
  @return true if the subject is authorized, otherwise false