Example usage for Java org.apache.shiro.subject Subject fields, constructors, methods, implement or subclass
The text is from its open source code.
Callable | associateWith(Callable Returns a Callable instance matching the given argument while additionally ensuring that it will retain and execute under this Subject's identity. |
Runnable | associateWith(Runnable runnable) Returns a Runnable instance matching the given argument while additionally ensuring that it will retain and execute under this Subject's identity. |
void | checkPermission(String permission) Ensures this Subject implies the specified permission String. |
void | checkPermission(Permission permission) Ensures this Subject Permission#implies(Permission) implies the specified Permission . |
void | checkPermissions(String... permissions) Ensures this Subject org.apache.shiro.authz.Permission#implies(org.apache.shiro.authz.Permission) implies all of the specified permission strings. |
void | checkPermissions(Collection Ensures this Subject org.apache.shiro.authz.Permission#implies(org.apache.shiro.authz.Permission) implies all of the specified permission strings. |
void | checkRole(String roleIdentifier) Asserts this Subject has the specified role by returning quietly if they do or throwing an org.apache.shiro.authz.AuthorizationException if they do not. |
void | checkRoles(Collection Asserts this Subject has all of the specified roles by returning quietly if they do or throwing an org.apache.shiro.authz.AuthorizationException if they do not. |
void | checkRoles(String... roleIdentifiers) Same as #checkRoles(Collection |
V | execute(Callable Associates the specified Callable with this Subject instance and then executes it on the currently running thread. |
void | execute(Runnable runnable) Associates the specified Runnable with this Subject instance and then executes it on the currently running thread. |
PrincipalCollection | getPreviousPrincipals() Returns the previous 'pre run as' identity of this Subject before assuming the current #runAs runAs identity, or null if this Subject is not operating under an assumed identity (normal state). |
Object | getPrincipal() Returns this Subject's application-wide uniquely identifying principal, or null if this Subject is anonymous because it doesn't yet have any associated account data (for example, if they haven't logged in). |
PrincipalCollection | getPrincipals() Returns this Subject's principals (identifying attributes) in the form of a PrincipalCollection or null if this Subject is anonymous because it doesn't yet have any associated account data (for example, if they haven't logged in). |
Session | getSession() Returns the application Session associated with this Subject. |
Session | getSession(boolean create) Returns the application Session associated with this Subject. |
boolean | hasAllRoles(Collection Returns true if this Subject has all of the specified roles, false otherwise. |
boolean | hasRole(String roleIdentifier) Returns true if this Subject has the specified role, false otherwise. |
boolean[] | hasRoles(List Checks if this Subject has the specified roles, returning a boolean array indicating which roles are associated. |
boolean | isAuthenticated() Returns true if this Subject/user proved their identity during their current session by providing valid credentials matching those known to the system, false otherwise. |
boolean | isPermitted(String permission) Returns true if this Subject is permitted to perform an action or access a resource summarized by the specified permission string. |
boolean | isPermitted(Permission permission) Returns true if this Subject is permitted to perform an action or access a resource summarized by the specified permission. |
boolean[] | isPermitted(String... permissions) Checks if this Subject implies the given permission strings and returns a boolean array indicating which permissions are implied. |
boolean[] | isPermitted(List Checks if this Subject implies the given Permissions and returns a boolean array indicating which permissions are implied. |
boolean | isPermittedAll(String... permissions) Returns true if this Subject implies all of the specified permission strings, false otherwise. |
boolean | isPermittedAll(Collection Returns true if this Subject implies all of the specified permissions, false otherwise. |
boolean | isRemembered() Returns true if this Subject has an identity (it is not anonymous) and the identity (aka #getPrincipals() principals ) is remembered from a successful authentication during a previous session. |
boolean | isRunAs() Returns true if this Subject is 'running as' another identity other than its original one or false otherwise (normal Subject state). |
void | login(AuthenticationToken token) Performs a login attempt for this Subject/user. |
void | logout() Logs out this Subject and invalidates and/or removes any associated entities, such as a Session Session and authorization data. |
PrincipalCollection | releaseRunAs() Releases the current 'run as' (assumed) identity and reverts back to the previous 'pre run as' identity that existed before #runAs runAs was called. |
void | runAs(PrincipalCollection principals) Allows this subject to 'run as' or 'assume' another identity indefinitely. |