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.
---
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.
---