Interface AuthorizationInfo
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
Account
- All Known Implementing Classes:
SimpleAccount,SimpleAuthorizationInfo
AuthorizationInfo represents a single Subject's stored authorization data (roles, permissions, etc.)
used during authorization (access control) checks only.
Roles are represented as a Collection of Strings
(Collectioninvalid input: '<'String>), typically each element being the Role name.
Permissions are provided in two ways:
- A
Collectionof Strings, where each String can usually be converted intoPermissionobjects by aRealm'sPermissionResolver - A
CollectionofPermissionobjects
AuthenticationInfo interface for use during the authentication
process that represents identity data such as principals and credentials.
Because many if not most Realms store both sets of data for a Subject, it might be
convenient for a Realm implementation to utilize an implementation of the
Account interface instead, which is a convenience interface that combines both
AuthenticationInfo and AuthorizationInfo. Whether you choose to implement these two
interfaces separately or implement the one Account interface for a given Realm is
entirely based on your application's needs or your preferences.- Since:
- 0.9
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns all type-safePermissions assigned to the corresponding Subject.getRoles()Returns the names of all roles assigned to a corresponding Subject.Returns all string-based permissions assigned to the corresponding Subject.
-
Method Details
-
getRoles
Returns the names of all roles assigned to a corresponding Subject.- Returns:
- the names of all roles assigned to a corresponding Subject.
-
getStringPermissions
Returns all string-based permissions assigned to the corresponding Subject. The permissions here plus those returned fromgetObjectPermissions()represent the total set of permissions assigned. The aggregate set is used to perform a permission authorization check. This method is a convenience mechanism that allows Realms to represent permissions as Strings if they choose. When performing a security check, aRealmusually converts these strings to objectPermissions via an internalPermissionResolverin order to perform the actual permission check. This is not a requirement of course, sinceRealms can perform security checks in whatever manner deemed necessary, but this explains the conversion mechanism that most Shiro Realms execute for string-based permission checks.- Returns:
- all string-based permissions assigned to the corresponding Subject.
-
getObjectPermissions
Returns all type-safePermissions assigned to the corresponding Subject. The permissions returned from this method plus any returned fromgetStringPermissions()represent the total set of permissions. The aggregate set is used to perform a permission authorization check.- Returns:
- all type-safe
Permissions assigned to the corresponding Subject.
-