From e1ffbdf466b6684b9dec57da2f17849b9bc45c72 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 23 Dec 2014 09:31:55 -0500 Subject: [PATCH] NIFI-65: - Adding methods to the AuthorityProvider to authorize the downloading of content. --- .../authorization/FileAuthorizationProvider.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nar-bundles/framework-bundle/framework/file-authorization-provider/src/main/java/org/apache/nifi/authorization/FileAuthorizationProvider.java b/nar-bundles/framework-bundle/framework/file-authorization-provider/src/main/java/org/apache/nifi/authorization/FileAuthorizationProvider.java index beedd8eda3..5657369ff8 100644 --- a/nar-bundles/framework-bundle/framework/file-authorization-provider/src/main/java/org/apache/nifi/authorization/FileAuthorizationProvider.java +++ b/nar-bundles/framework-bundle/framework/file-authorization-provider/src/main/java/org/apache/nifi/authorization/FileAuthorizationProvider.java @@ -21,6 +21,8 @@ import java.io.IOException; import java.util.Collection; import java.util.EnumSet; import java.util.HashSet; +import java.util.List; +import java.util.Map; import java.util.Set; import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; @@ -492,6 +494,20 @@ public class FileAuthorizationProvider implements AuthorityProvider { } } + /** + * Grants access to download content regardless of FlowFile attributes. + * + * @param dnChain + * @param attributes + * @return + * @throws UnknownIdentityException + * @throws AuthorityAccessException + */ + @Override + public DownloadAuthorization authorizeDownload(List dnChain, Map attributes) throws UnknownIdentityException, AuthorityAccessException { + return DownloadAuthorization.approved(); + } + /** * Locates the user with the specified DN. *