[ 
https://issues.apache.org/jira/browse/NIFI-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15435517#comment-15435517
 ] 

ASF GitHub Bot commented on NIFI-2642:
--------------------------------------

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

    https://github.com/apache/nifi/pull/931#discussion_r76122724
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/authorization/AuthorizeControllerServiceReference.java
 ---
    @@ -57,8 +58,12 @@ public static void 
authorizeControllerServiceReferences(final Map<String, String
                         if (!Objects.equals(currentValue, proposedValue)) {
                             // ensure access to the old service
                             if (currentValue != null) {
    -                            final Authorizable currentServiceAuthorizable 
= lookup.getControllerService(currentValue).getAuthorizable();
    -                            
currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
    +                            try {
    +                                final Authorizable 
currentServiceAuthorizable = 
lookup.getControllerService(currentValue).getAuthorizable();
    +                                
currentServiceAuthorizable.authorize(authorizer, RequestAction.READ, user);
    +                            } catch (ResourceNotFoundException e) {
    +                                // ignore if the resource is not found, if 
currentValue was previously deleted, it should not stop assignment of 
proposedValue
    --- End diff --
    
    That section of code can still raise an AccessDeniedException, we're just 
ignoring the RNFE in this specific case.  There are probably other cases where 
the RNFE would bubble up to the UI, where the exception mapper would handle it 
properly, but in this case it was preventing the new controller service to be 
assigned.  I think for 1.0.0, this is the best fix.


> Processors referring to deleted controller services cannot select 
> new/existing controller services
> --------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-2642
>                 URL: https://issues.apache.org/jira/browse/NIFI-2642
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Matt Burgess
>            Assignee: Matt Gilman
>             Fix For: 1.0.0
>
>
> If a processor refers to a deleted controller service (CS), then in the 
> processor's configuration dialog, the ID of the deleted CS is displayed. 
> However if the user selects an existing (or new) CS from the drop-down menu, 
> an error dialog is displayed, saying no CS can be found for the ID of the one 
> that was deleted.
> Reproduction example:
> 1) Create two DBCPConnectionPools (with different names)
> 2) Add a QueryDatabaseTable processor to the canvas
> 3) In the QDT dialog, select one DBCPConnectionPool and Apply
> 4) Delete that DBCPConnectionPool
> 5) Open the QDT dialog again, verify an ID is displayed (make a note of the 
> ID).
> 6) Select the other DBCPConnectionPool from the drop-down menu and Apply
> 7) The error dialog is displayed with the deleted CS's ID



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to