Search in sources :

Example 1 with ConfigurableAccessPolicyProvider

use of org.apache.nifi.registry.security.authorization.ConfigurableAccessPolicyProvider in project nifi-registry by apache.

the class AuthorizationService method deleteAccessPolicy.

public AccessPolicy deleteAccessPolicy(String identifier) {
    verifyAccessPolicyProviderIsConfigurable();
    writeLock.lock();
    try {
        AccessPolicy deletedAccessPolicyDTO = getAccessPolicy(identifier);
        if (deletedAccessPolicyDTO != null) {
            ((ConfigurableAccessPolicyProvider) accessPolicyProvider).deleteAccessPolicy(identifier);
        }
        return deletedAccessPolicyDTO;
    } finally {
        writeLock.unlock();
    }
}
Also used : ConfigurableAccessPolicyProvider(org.apache.nifi.registry.security.authorization.ConfigurableAccessPolicyProvider) AccessPolicy(org.apache.nifi.registry.authorization.AccessPolicy)

Example 2 with ConfigurableAccessPolicyProvider

use of org.apache.nifi.registry.security.authorization.ConfigurableAccessPolicyProvider in project nifi-registry by apache.

the class AuthorizerCapabilityDetection method isAccessPolicyConfigurable.

public static boolean isAccessPolicyConfigurable(final Authorizer authorizer, final AccessPolicy accessPolicy) {
    if (!isConfigurableAccessPolicyProvider(authorizer)) {
        return false;
    }
    final ManagedAuthorizer managedAuthorizer = (ManagedAuthorizer) authorizer;
    final ConfigurableAccessPolicyProvider configurableAccessPolicyProvider = (ConfigurableAccessPolicyProvider) managedAuthorizer.getAccessPolicyProvider();
    return configurableAccessPolicyProvider.isConfigurable(accessPolicy);
}
Also used : ManagedAuthorizer(org.apache.nifi.registry.security.authorization.ManagedAuthorizer) ConfigurableAccessPolicyProvider(org.apache.nifi.registry.security.authorization.ConfigurableAccessPolicyProvider)

Aggregations

ConfigurableAccessPolicyProvider (org.apache.nifi.registry.security.authorization.ConfigurableAccessPolicyProvider)2 AccessPolicy (org.apache.nifi.registry.authorization.AccessPolicy)1 ManagedAuthorizer (org.apache.nifi.registry.security.authorization.ManagedAuthorizer)1