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

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

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

    https://github.com/apache/nifi/pull/931#discussion_r76121783
  
    --- 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 --
    
    I wonder if instead of raising and then catching exception and do nothing 
we should instead introduce  ```canLocate(id)``` or ```isLocatable```?


> 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