public class SwarmStrategy extends AbstractSwarmStrategy
ClassAuthorizationStrategy. It allows for both simple logins as well
as multi level logins.IAuthorizationStrategy.AllowAllAuthorizationStrategyloginContainerMESSAGE_KEYALLOW_ALL| Constructor and Description |
|---|
SwarmStrategy(Class<? extends org.wicketstuff.security.components.ISecureComponent> secureClass,
Object hiveQueen)
Constructs a new strategy linked to the specified hive.
|
SwarmStrategy(Object hiveQueen)
Constructs a new strategy linked to the specified hive.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.wicketstuff.security.hive.Hive |
getHive()
Returns the hive.
|
protected LoginContainer |
getLoginContainer()
The
LoginContainer keeps track of all Subjects for this session.. |
boolean |
hasPermission(org.wicketstuff.security.hive.authorization.Permission permission,
org.wicketstuff.security.hive.authentication.Subject subject)
Performs the actual permission check at the
Hive. |
boolean |
isResourceAuthorized(IResource resource,
PageParameters parameters) |
boolean |
isUserAuthenticated() |
void |
login(Object context)
Logs a user in.
|
boolean |
logoff(Object context)
Loggs a user off.
|
protected void |
logPermissionDenied(org.wicketstuff.security.hive.authorization.Permission permission,
org.wicketstuff.security.hive.authentication.Subject subject)
Logs (if logging is enabled) which permission was denied for a subject.
|
getSubject, hasPermission, isClassAuthenticated, isClassAuthorized, isComponentAuthenticated, isComponentAuthorized, isModelAuthenticated, isModelAuthorizeddestroy, getClassChecks, getClassChecks, getExceptionMessage, isInstantiationAuthorizedpublic SwarmStrategy(Object hiveQueen)
hiveQueen - A key to retrieve the Hivepublic SwarmStrategy(Class<? extends org.wicketstuff.security.components.ISecureComponent> secureClass, Object hiveQueen)
secureClass - instances of this class will be required to have access authorization.hiveQueen - A key to retrieve the Hiveprotected final org.wicketstuff.security.hive.Hive getHive()
org.wicketstuff.security.strategies.SecurityException - if no hive is registered.public boolean hasPermission(org.wicketstuff.security.hive.authorization.Permission permission,
org.wicketstuff.security.hive.authentication.Subject subject)
Hive.hasPermission in class AbstractSwarmStrategypermission - the permission to verifysubject - optional subject to test against the permissionorg.wicketstuff.security.strategies.SecurityException - if the permission is nullprotected void logPermissionDenied(org.wicketstuff.security.hive.authorization.Permission permission,
org.wicketstuff.security.hive.authentication.Subject subject)
IAuthorizationMessageSource for later retrieval. The
following variables are stored: "permission","actions", "subject" and "principals" where
principals is a collection of principals that contain the permission and actions is a
String representing all the WaspActions required. Note that the subject
variable might be null.permission - permission that was denied.subject - optional subjectWaspAuthorizationStrategy.logMessages(),
WaspAuthorizationStrategy.getMessageSource()public void login(Object context) throws org.wicketstuff.security.authentication.LoginException
LoginContext.login in class org.wicketstuff.security.strategies.WaspAuthorizationStrategyorg.wicketstuff.security.authentication.LoginExceptionWaspAuthorizationStrategy.login(java.lang.Object)public boolean logoff(Object context)
LoginContext and must
be the same (or equal) to the logincontext used to log in.logoff in class org.wicketstuff.security.strategies.WaspAuthorizationStrategyWaspAuthorizationStrategy.logoff(Object)protected final LoginContainer getLoginContainer()
LoginContainer keeps track of all Subjects for this session..public boolean isUserAuthenticated()
isUserAuthenticated in class org.wicketstuff.security.strategies.WaspAuthorizationStrategyWaspAuthorizationStrategy.isUserAuthenticated()public boolean isResourceAuthorized(IResource resource, PageParameters parameters)
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.