use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizerCapabilityDetection method isConfigurableUserGroupProvider.
public static boolean isConfigurableUserGroupProvider(final Authorizer authorizer) {
if (!isManagedAuthorizer(authorizer)) {
return false;
}
final ManagedAuthorizer managedAuthorizer = (ManagedAuthorizer) authorizer;
final AccessPolicyProvider accessPolicyProvider = managedAuthorizer.getAccessPolicyProvider();
return accessPolicyProvider.getUserGroupProvider() instanceof ConfigurableUserGroupProvider;
}
use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizationService method updateUserGroup.
public UserGroup updateUserGroup(UserGroup userGroup) {
verifyUserGroupProviderIsConfigurable();
writeLock.lock();
try {
final org.apache.nifi.registry.security.authorization.Group updatedGroup = ((ConfigurableUserGroupProvider) userGroupProvider).updateGroup(userGroupFromDTO(userGroup));
if (updatedGroup == null) {
return null;
}
return userGroupToDTO(updatedGroup);
} finally {
writeLock.unlock();
}
}
use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizationService method deleteUserGroup.
public UserGroup deleteUserGroup(String identifier) {
verifyUserGroupProviderIsConfigurable();
writeLock.lock();
try {
final UserGroup userGroupDTO = getUserGroup(identifier);
if (userGroupDTO != null) {
((ConfigurableUserGroupProvider) userGroupProvider).deleteGroup(identifier);
}
return userGroupDTO;
} finally {
writeLock.unlock();
}
}
use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizationService method deleteUser.
public User deleteUser(String identifier) {
verifyUserGroupProviderIsConfigurable();
this.writeLock.lock();
try {
User deletedUserDTO = getUser(identifier);
if (deletedUserDTO != null) {
((ConfigurableUserGroupProvider) userGroupProvider).deleteUser(identifier);
}
return deletedUserDTO;
} finally {
this.writeLock.unlock();
}
}
use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizerCapabilityDetection method isGroupConfigurable.
public static boolean isGroupConfigurable(final Authorizer authorizer, final Group group) {
if (!isConfigurableUserGroupProvider(authorizer)) {
return false;
}
final ManagedAuthorizer managedAuthorizer = (ManagedAuthorizer) authorizer;
final ConfigurableUserGroupProvider configurableUserGroupProvider = (ConfigurableUserGroupProvider) managedAuthorizer.getAccessPolicyProvider().getUserGroupProvider();
return configurableUserGroupProvider.isConfigurable(group);
}
Aggregations