Github user kevdoran commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/3043#discussion_r222308394
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
 ---
    @@ -232,16 +232,21 @@ public void 
onConfigured(AuthorizerConfigurationContext configurationContext) th
                 nodeGroupIdentifier = null;
     
                 if (nodeGroupName != null) {
    -                for (Group group : userGroupProvider.getGroups()) {
    -                    if (group.getName().equals(nodeGroupName)) {
    -                        nodeGroupIdentifier = group.getIdentifier();
    -                        break;
    +                if (!StringUtils.isBlank(nodeGroupName)) {
    +                    logger.debug("Trying to load node group '{}' from the 
underlying userGroupProvider", nodeGroupName);
    +                    for (Group group : userGroupProvider.getGroups()) {
    +                        if (group.getName().equals(nodeGroupName)) {
    +                            nodeGroupIdentifier = group.getIdentifier();
    +                            break;
    +                        }
                         }
    -                }
     
    -                if (nodeGroupIdentifier == null) {
    -                    throw new AuthorizerCreationException(String.format(
    +                    if (nodeGroupIdentifier == null) {
    +                        throw new 
AuthorizerCreationException(String.format(
                                 "Authorizations node group '%s' could not be 
found", nodeGroupName));
    +                    }
    +                } else {
    +                    logger.warn("Empty node group name provided");
    --- End diff --
    
    I don't think this merits a warning, given that it empty by default. 
Perhaps a debug message would be appropriate.


---

Reply via email to