use of org.apache.nifi.registry.security.authorization.AccessPolicyProviderLookup in project nifi-registry by apache.
the class FileAuthorizer method initialize.
@Override
public void initialize(final AuthorizerInitializationContext initializationContext) throws SecurityProviderCreationException {
// initialize the user group provider
userGroupProvider.initialize(new UserGroupProviderInitializationContext() {
@Override
public String getIdentifier() {
return FILE_USER_GROUP_PROVIDER_ID;
}
@Override
public UserGroupProviderLookup getUserGroupProviderLookup() {
return (identifier) -> null;
}
});
// initialize the access policy provider
accessPolicyProvider.initialize(new AccessPolicyProviderInitializationContext() {
@Override
public String getIdentifier() {
return FILE_ACCESS_POLICY_PROVIDER_ID;
}
@Override
public UserGroupProviderLookup getUserGroupProviderLookup() {
return (identifier) -> {
if (FILE_USER_GROUP_PROVIDER_ID.equals(identifier)) {
return userGroupProvider;
}
return null;
};
}
@Override
public AccessPolicyProviderLookup getAccessPolicyProviderLookup() {
return (identifier) -> null;
}
});
}
Aggregations