Search in sources :

Example 1 with PermissionResolver

use of org.apache.shiro.authz.permission.PermissionResolver in project ddf by codice.

the class AuthzRealm method resolvePermissions.

/**
     * Returns a collection of {@link Permission} objects that are built from the associated
     * collection of Strings.
     *
     * @param stringPerms collection of Strings that represent permissions.
     * @return collection of Permissions
     */
private Collection<Permission> resolvePermissions(Collection<String> stringPerms) {
    Collection<Permission> perms = Collections.emptySet();
    PermissionResolver resolver = getPermissionResolver();
    if (resolver != null && !CollectionUtils.isEmpty(stringPerms)) {
        perms = new HashSet<>(stringPerms.size());
        for (String strPermission : stringPerms) {
            Permission permission = getPermissionResolver().resolvePermission(strPermission);
            perms.add(permission);
        }
    }
    return perms;
}
Also used : MatchOneCollectionPermission(ddf.security.permission.MatchOneCollectionPermission) CollectionPermission(ddf.security.permission.CollectionPermission) KeyValuePermission(ddf.security.permission.KeyValuePermission) Permission(org.apache.shiro.authz.Permission) KeyValueCollectionPermission(ddf.security.permission.KeyValueCollectionPermission) RolePermissionResolver(org.apache.shiro.authz.permission.RolePermissionResolver) PermissionResolver(org.apache.shiro.authz.permission.PermissionResolver)

Aggregations

CollectionPermission (ddf.security.permission.CollectionPermission)1 KeyValueCollectionPermission (ddf.security.permission.KeyValueCollectionPermission)1 KeyValuePermission (ddf.security.permission.KeyValuePermission)1 MatchOneCollectionPermission (ddf.security.permission.MatchOneCollectionPermission)1 Permission (org.apache.shiro.authz.Permission)1 PermissionResolver (org.apache.shiro.authz.permission.PermissionResolver)1 RolePermissionResolver (org.apache.shiro.authz.permission.RolePermissionResolver)1