Package org.apache.shiro.authz
Interface AuthorizationInfo
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
Account
- All Known Implementing Classes:
SimpleAccount,SimpleAuthorizationInfo
public interface AuthorizationInfo extends Serializable
AuthorizationInforepresents a single Subject's stored authorization data (roles, permissions, etc) used during authorization (access control) checks only. Roles are represented as aCollectionof Strings (Collection<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
AuthenticationInfointerface for use during the authentication process that represents identity data such as principals and credentials. Because many if not mostRealms store both sets of data for a Subject, it might be convenient for aRealmimplementation to utilize an implementation of theAccountinterface instead, which is a convenience interface that combines bothAuthenticationInfoandAuthorizationInfo. Whether you choose to implement these two interfaces separately or implement the oneAccountinterface for a givenRealmis entirely based on your application's needs or your preferences.- Since:
- 0.9
- See Also:
AuthenticationInfo,Account
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<Permission>getObjectPermissions()Returns all type-safePermissions assigned to the corresponding Subject.Collection<String>getRoles()Returns the names of all roles assigned to a corresponding Subject.Collection<String>getStringPermissions()Returns all string-based permissions assigned to the corresponding Subject.
-
-
-
Method Detail
-
getRoles
Collection<String> getRoles()
Returns the names of all roles assigned to a corresponding Subject.- Returns:
- the names of all roles assigned to a corresponding Subject.
-
getStringPermissions
Collection<String> 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
Collection<Permission> 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.
-
-