From 7e1ecad738396e78b4cf7997548d539cb5df8bf2 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Thu, 13 Apr 2017 16:14:45 -0400 Subject: [PATCH] NIFI-3706: - Removing non-existent resource when converting a legacy authorized users file. This closes #1673. Signed-off-by: Bryan Bende --- .../java/org/apache/nifi/authorization/RoleAccessPolicy.java | 1 - .../org/apache/nifi/authorization/FileAuthorizerTest.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/RoleAccessPolicy.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/RoleAccessPolicy.java index 03186bc257..6ee09fe167 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/RoleAccessPolicy.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/RoleAccessPolicy.java @@ -104,7 +104,6 @@ public final class RoleAccessPolicy { final Set nifiPolicies = new HashSet<>(); nifiPolicies.add(new RoleAccessPolicy(ResourceType.Controller.getValue(), READ_ACTION)); nifiPolicies.add(new RoleAccessPolicy(ResourceType.SiteToSite.getValue(), READ_ACTION)); - nifiPolicies.add(new RoleAccessPolicy(ResourceType.SiteToSite.getValue(), WRITE_ACTION)); roleAccessPolicies.put(Role.ROLE_NIFI, Collections.unmodifiableSet(nifiPolicies)); return roleAccessPolicies; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java index 394aff566e..de76d936e6 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/test/java/org/apache/nifi/authorization/FileAuthorizerTest.java @@ -355,8 +355,8 @@ public class FileAuthorizerTest { assertEquals(3, user6Policies.size()); assertTrue(user6Policies.containsKey(ResourceType.SiteToSite.getValue())); - assertEquals(2, user6Policies.get(ResourceType.SiteToSite.getValue()).size()); - assertTrue(user6Policies.get(ResourceType.SiteToSite.getValue()).contains(RequestAction.WRITE)); + assertEquals(1, user6Policies.get(ResourceType.SiteToSite.getValue()).size()); + assertTrue(user6Policies.get(ResourceType.SiteToSite.getValue()).contains(RequestAction.READ)); final Resource inputPortResource = ResourceFactory.getDataTransferResource( ResourceFactory.getComponentResource(ResourceType.InputPort, "2f7d1606-b090-4be7-a592-a5b70fb55531", "TCP Input"));