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;
}
Aggregations