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

    https://github.com/apache/nifi/pull/884#discussion_r75307313
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
 ---
    @@ -2084,7 +2086,45 @@ public Response getComponentHistory(
                 )
                 @PathParam("componentId") final String componentId) {
     
    -        authorizeFlow();
    +        serviceFacade.authorizeAccess(lookup -> {
    +            final NiFiUser user = NiFiUserUtils.getNiFiUser();
    +
    +            // authorize the flow
    +            authorizeFlow();
    +
    +            boolean authorized = false;
    +            try {
    +                final Authorizable authorizable = 
lookup.getProcessor(componentId).getAuthorizable();
    +                authorizable.authorize(authorizer, RequestAction.READ, 
user);
    +                authorized = true;
    +            } catch (final ResourceNotFoundException e) {
    +                // ignore as the component may not be a processor
    +            }
    +
    +            if (!authorized) {
    +                try {
    +                    final Authorizable authorizable = 
lookup.getControllerService(componentId).getAuthorizable();
    +                    authorizable.authorize(authorizer, RequestAction.READ, 
user);
    +                    authorized = true;
    +                } catch (final ResourceNotFoundException e) {
    +                    // ignore as the component may not be a processor
    --- End diff --
    
    copy/paste error? Should be "may not be a controller service"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to