dan-s1 commented on code in PR #10134:
URL: https://github.com/apache/nifi/pull/10134#discussion_r2231082360


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/authorization/StandardAuthorizableLookup.java:
##########
@@ -569,28 +569,8 @@ public Authorizable getAuthorizableFromResource(final 
String resource) {
             case DataTransfer:
             case ProvenanceData:
             case Operation:
-
-                // get the resource type
-                final String baseResource = 
StringUtils.substringAfter(resource, resourceType.getValue());
-                final ResourceType baseResourceType = 
ResourceType.fromRawValue(baseResource);
-
-                if (baseResourceType == null) {
-                    throw new ResourceNotFoundException("Unrecognized base 
resource: " + resource);
-                }
-
-                switch (resourceType) {
-                    case Policy:
-                        return new 
AccessPolicyAuthorizable(getAccessPolicy(baseResourceType, resource));
-                    case Data:
-                        return new 
DataAuthorizable(getAccessPolicy(baseResourceType, resource));
-                    case DataTransfer:
-                        return new 
DataTransferAuthorizable(getAccessPolicy(baseResourceType, resource));
-                    case ProvenanceData:
-                        return new 
ProvenanceDataAuthorizable(getAccessPolicy(baseResourceType, resource));
-                    case Operation:
-                        return new 
OperationAuthorizable(getAccessPolicy(baseResourceType, resource));
-                }
-            // fallthrough
+                final Authorizable authorizable = 
handleResourceTypeContainingOtherResourceType(resource, resourceType);
+                return authorizable;

Review Comment:
   Sure I can do that although from past reviews I thought you seem to prefer 
having a variable declared.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to