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

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

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

    https://github.com/apache/nifi/pull/574#discussion_r72070362
  
    --- Diff: 
nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-plugin/src/main/java/org/apache/nifi/ranger/authorization/RangerBasePluginWithPolicies.java
 ---
    @@ -0,0 +1,83 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.nifi.ranger.authorization;
    +
    +import org.apache.ranger.plugin.model.RangerPolicy;
    +import org.apache.ranger.plugin.service.RangerBasePlugin;
    +import org.apache.ranger.plugin.util.ServicePolicies;
    +
    +import java.util.HashSet;
    +import java.util.Map;
    +import java.util.Set;
    +import java.util.concurrent.atomic.AtomicReference;
    +
    +/**
    + * Extends the base plugin to add ability to check if a policy exists for 
a given resource.
    + */
    +public class RangerBasePluginWithPolicies extends RangerBasePlugin {
    +
    +    private AtomicReference<Set<String>> resources = new 
AtomicReference<>(new HashSet<>());
    +
    +    public RangerBasePluginWithPolicies(String serviceType, String appId) {
    +        super(serviceType, appId);
    +    }
    +
    +    @Override
    +    public void setPolicies(ServicePolicies policies) {
    +        super.setPolicies(policies);
    +
    +        final Set<String> newResources = new HashSet<>();
    +
    +        if (policies.getPolicies() != null) {
    --- End diff --
    
    Agreed, will see if I can convert that


> Create Authorizer implementation that uses Apache Ranger
> --------------------------------------------------------
>
>                 Key: NIFI-1733
>                 URL: https://issues.apache.org/jira/browse/NIFI-1733
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Bryan Bende
>            Assignee: Bryan Bende
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> In NIFI-1552 we defined a new Authorizer API for 1.0.0. 
> In addition to the standard file-based Authorizer, we should provide an 
> Authorizer implementation that uses Apache Ranger.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to