Search in sources :

Example 41 with Permissions

use of org.apache.nifi.registry.authorization.Permissions in project nifi-registry by apache.

the class PermissionsService method createPermissionsForBucketId.

private Permissions createPermissionsForBucketId(String bucketId, final Permissions knownPermissions) {
    Authorizable bucketResource = authorizableLookup.getBucketAuthorizable(bucketId);
    Permissions permissions = knownPermissions == null ? authorizationService.getPermissionsForResource(bucketResource) : authorizationService.getPermissionsForResource(bucketResource, knownPermissions);
    return permissions;
}
Also used : Permissions(org.apache.nifi.registry.authorization.Permissions) Authorizable(org.apache.nifi.registry.security.authorization.resource.Authorizable)

Example 42 with Permissions

use of org.apache.nifi.registry.authorization.Permissions in project nifi-registry by apache.

the class PermissionsService method populateBucketPermissions.

public void populateBucketPermissions(final Iterable<Bucket> buckets) {
    Permissions topLevelBucketPermissions = authorizationService.getPermissionsForResource(authorizableLookup.getBucketsAuthorizable());
    buckets.forEach(b -> populateBucketPermissions(b, topLevelBucketPermissions));
}
Also used : Permissions(org.apache.nifi.registry.authorization.Permissions)

Example 43 with Permissions

use of org.apache.nifi.registry.authorization.Permissions in project nifi-registry by apache.

the class PermissionsService method populateItemPermissions.

private void populateItemPermissions(final BucketItem bucketItem, final Permissions knownPermissions) {
    if (bucketItem == null) {
        return;
    }
    Permissions bucketItemPermissions = createPermissionsForBucketId(bucketItem.getBucketIdentifier(), knownPermissions);
    bucketItem.setPermissions(bucketItemPermissions);
}
Also used : Permissions(org.apache.nifi.registry.authorization.Permissions)

Aggregations

Permissions (org.apache.nifi.registry.authorization.Permissions)43 Response (javax.ws.rs.core.Response)31 Sets (com.google.common.collect.Sets)30 IOException (java.io.IOException)30 StandardCharsets (java.nio.charset.StandardCharsets)30 ArrayList (java.util.ArrayList)30 Arrays (java.util.Arrays)30 Collection (java.util.Collection)30 Collections (java.util.Collections)30 Comparator (java.util.Comparator)30 Date (java.util.Date)30 HashMap (java.util.HashMap)30 HashSet (java.util.HashSet)30 LinkedHashMap (java.util.LinkedHashMap)30 LinkedHashSet (java.util.LinkedHashSet)30 List (java.util.List)30 ListIterator (java.util.ListIterator)30 Map (java.util.Map)30 Objects (java.util.Objects)30 Optional (java.util.Optional)30