public class ComponentSecurityCheck extends AbstractSecurityCheck
ISecureModel
if it exists. Note that this check always authenticates the user, this is
only to make it easier to put a secure component on a non secure page and have it redirect to the
login. Usually the secure page will have checked authentication already. Both
ISecureModel
and this check need to authenticate / authorize the user before an approval
is given.Constructor and Description |
---|
ComponentSecurityCheck(org.apache.wicket.Component component)
Constructs a ComponentSecurityCheck that never checks the model.
|
ComponentSecurityCheck(org.apache.wicket.Component component,
boolean checkSecureModelIfExists)
Constructs a ComponentSecurityCheck that optionally checks the model.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkSecureModel()
Flags if we need to check the
ISecureModel of a component if it exists at all. |
protected org.apache.wicket.Component |
getComponent()
Returns the target component for this securitycheck.
|
boolean |
isActionAuthorized(WaspAction action)
Checks if the user is authorized for this component.
|
boolean |
isAuthenticated()
Checks if the user is authenticated for this component.
|
getActionFactory, getLoginPage, getStrategy, isActionAuthorized
public ComponentSecurityCheck(org.apache.wicket.Component component)
component
- the target component for this security check.ISecureComponent.setSecurityCheck(ISecurityCheck)
,
SecureComponentHelper.setSecurityCheck(Component, ISecurityCheck)
public ComponentSecurityCheck(org.apache.wicket.Component component, boolean checkSecureModelIfExists)
component
- the target component for this security check.checkSecureModelIfExists
- forces the model to be checked after this check is firedISecureComponent.setSecurityCheck(ISecurityCheck)
,
SecureComponentHelper.setSecurityCheck(Component, ISecurityCheck)
public boolean isAuthenticated()
ISecurityCheck.isAuthenticated()
,
WaspAuthorizationStrategy.isComponentAuthenticated(Component)
protected final org.apache.wicket.Component getComponent()
public boolean isActionAuthorized(WaspAction action)
action
- the action(s) like render or enable.ISecurityCheck.isActionAuthorized(WaspAction)
,
WaspAuthorizationStrategy.isComponentAuthorized(Component, WaspAction)
,
WaspAuthorizationStrategy.isModelAuthorized(ISecureModel, Component, WaspAction)
protected final boolean checkSecureModel()
ISecureModel
of a component if it exists at all.Copyright © 2015. All rights reserved.