|
| 1 | +From e69a23a6b3181582d0638db00cf1caf81eff56ff Mon Sep 17 00:00:00 2001 |
| 2 | +From: Andrew Kenworthy <andrew.kenworthy@stackable.tech> |
| 3 | +Date: Thu, 16 Oct 2025 09:24:39 +0200 |
| 4 | +Subject: re-parse flow |
| 5 | + |
| 6 | +--- |
| 7 | + .../nifi/authorization/FileAccessPolicyProvider.java | 9 +++++++++ |
| 8 | + 1 file changed, 9 insertions(+) |
| 9 | + |
| 10 | +diff --git a/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java b/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java |
| 11 | +index cb16cd1a30..17b3f3929d 100644 |
| 12 | +--- a/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java |
| 13 | ++++ b/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java |
| 14 | +@@ -754,7 +754,12 @@ public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvide |
| 15 | + * then use "root" as a placeholder. |
| 16 | + */ |
| 17 | + public void replaceWithRootGroupId() throws JAXBException { |
| 18 | ++ if (rootGroupId == null) { |
| 19 | ++ logger.info("Parsing flow as rootGroupId is not yet defined"); |
| 20 | ++ parseFlow(); |
| 21 | ++ } |
| 22 | + if (rootGroupId != null) { |
| 23 | ++ logger.info("Parsing root group with {}", rootGroupId); |
| 24 | + Authorizations authorizations = this.authorizationsHolder.get().getAuthorizations(); |
| 25 | + boolean authorizationsChanged = false; |
| 26 | + for (Policy policy: authorizations.getPolicies().getPolicy()) { |
| 27 | +@@ -769,6 +774,10 @@ public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvide |
| 28 | + if (authorizationsChanged) { |
| 29 | + saveAuthorizations(authorizations); |
| 30 | + } |
| 31 | ++ } else { |
| 32 | ++ // this is not expected as this is called from the flow service |
| 33 | ++ // once it has been configured |
| 34 | ++ logger.info("rootGroupId still not established!"); |
| 35 | + } |
| 36 | + } |
| 37 | + |
0 commit comments