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();
}
}
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);
}
Aggregations