public class Permissions extends Object
Can be used to parse all present Permission
and
NotPermission
annotations for a given element.
Can also be used to expand a permission profile defined in security.profiles into an effective list of permissions.
Modifier and Type | Field and Description |
---|---|
protected static Map<String,Set<String>> |
profilesCache |
protected static List<String> |
publicRoles |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
applyProfiles(Collection<String> roles)
Expands all permission profiles to obtain the effective set of permissions for a given list or permission and
profile names.
|
static Set<String> |
applyProfilesAndPublicRoles(Collection<String> roles)
Expands all permission profiles just like
applyProfiles(java.util.Collection) . |
static Set<String> |
computePermissionsFromAnnotations(AnnotatedElement object)
Parses all available permission annotations for the given element.
|
static boolean |
wearsPermissionAnnotation(AnnotatedElement object)
Determines if the given element wears a permission annotation.
|
public static Set<String> applyProfiles(Collection<String> roles)
roles
- the list of permissions and or profiles to expandpublic static Set<String> applyProfilesAndPublicRoles(Collection<String> roles)
applyProfiles(java.util.Collection)
. Also all public roles
defined in security.publicRoles are included to the roles set before profiles are expanded.roles
- the list of permissions and or profiles to expandpublic static Set<String> computePermissionsFromAnnotations(AnnotatedElement object)
object
- the element for check for permissionspublic static boolean wearsPermissionAnnotation(AnnotatedElement object)
object
- the java element to checkPermission
,
PermissionList
,
NotPermission
,
NotPermissionList
,
LoginRequired
Copyright © 2018. All rights reserved.