Search in sources :

Example 6 with ConfigurableUserGroupProvider

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);
}
Also used : ManagedAuthorizer(org.apache.nifi.registry.security.authorization.ManagedAuthorizer) ConfigurableUserGroupProvider(org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider)

Example 7 with ConfigurableUserGroupProvider

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();
    }
}
Also used : Group(org.apache.nifi.registry.security.authorization.Group) ConfigurableUserGroupProvider(org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider)

Aggregations

ConfigurableUserGroupProvider (org.apache.nifi.registry.security.authorization.ConfigurableUserGroupProvider)7 ManagedAuthorizer (org.apache.nifi.registry.security.authorization.ManagedAuthorizer)3 Group (org.apache.nifi.registry.security.authorization.Group)2 CurrentUser (org.apache.nifi.registry.authorization.CurrentUser)1 User (org.apache.nifi.registry.authorization.User)1 UserGroup (org.apache.nifi.registry.authorization.UserGroup)1 AccessPolicyProvider (org.apache.nifi.registry.security.authorization.AccessPolicyProvider)1 ConfigurableAccessPolicyProvider (org.apache.nifi.registry.security.authorization.ConfigurableAccessPolicyProvider)1 NiFiUser (org.apache.nifi.registry.security.authorization.user.NiFiUser)1