use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizerCapabilityDetection method isUserConfigurable.
public static boolean isUserConfigurable(final Authorizer authorizer, final User user) {
if (!isConfigurableUserGroupProvider(authorizer)) {
return false;
}
final ManagedAuthorizer managedAuthorizer = (ManagedAuthorizer) authorizer;
final ConfigurableUserGroupProvider configurableUserGroupProvider = (ConfigurableUserGroupProvider) managedAuthorizer.getAccessPolicyProvider().getUserGroupProvider();
return configurableUserGroupProvider.isConfigurable(user);
}
use of org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider in project nifi-registry by apache.
the class AuthorizationService method createUserGroup.
// ---------------------- User Group methods --------------------------------------
public UserGroup createUserGroup(UserGroup userGroup) {
verifyUserGroupProviderIsConfigurable();
writeLock.lock();
try {
final org.apache.nifi.registry.security.authorization.Group createdGroup = ((ConfigurableUserGroupProvider) userGroupProvider).addGroup(userGroupFromDTO(userGroup));
return userGroupToDTO(createdGroup);
} finally {
writeLock.unlock();
}
}
Aggregations