|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.authorization.strategies.role.AbstractRoleAuthorizationStrategy
org.apache.wicket.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy
public class MetaDataRoleAuthorizationStrategy
Strategy that uses the Wicket metadata facility to check authorization. The static
authorize methods are for authorizing component actions and component
instantiation by role. This class is the main entry point for users wanting to use the
roles-based authorization of the wicket-auth-roles package based on wicket metadata.
For instance, use like:
MetaDataRoleAuthorizationStrategy.authorize(myPanel, RENDER, "ADMIN");for actions on component instances, or:
MetaDataRoleAuthorizationStrategy.authorize(AdminBookmarkablePage.class, "ADMIN");for doing role based authorization for component instantation.
MetaDataKey| Field Summary | |
|---|---|
static org.apache.wicket.MetaDataKey<org.apache.wicket.authorization.strategies.role.metadata.ActionPermissions> |
ACTION_PERMISSIONS
Component meta data key for actions/roles information. |
static org.apache.wicket.MetaDataKey<InstantiationPermissions> |
INSTANTIATION_PERMISSIONS
Application meta data key for actions/roles information. |
static java.lang.String |
NO_ROLE
Special role string for denying access to all |
| Fields inherited from interface org.apache.wicket.authorization.IAuthorizationStrategy |
|---|
ALLOW_ALL |
| Constructor Summary | |
|---|---|
MetaDataRoleAuthorizationStrategy(IRoleCheckingStrategy roleCheckingStrategy)
Construct. |
|
| Method Summary | |
|---|---|
static void |
authorize(java.lang.Class<? extends org.apache.wicket.Component> componentClass,
java.lang.String roles)
Authorizes the given role to create component instances of type componentClass. |
static void |
authorize(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action,
java.lang.String roles)
Authorizes the given role to perform the given action on the given component. |
static void |
authorizeAll(java.lang.Class<? extends org.apache.wicket.Component> componentClass)
Grants permission to all roles to create instances of the given component class. |
static void |
authorizeAll(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action)
Grants permission to all roles to perform the given action on the given component. |
boolean |
isActionAuthorized(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action)
Uses component level meta data to match roles for component action execution. |
boolean |
isInstantiationAuthorized(java.lang.Class componentClass)
Uses application level meta data to match roles for component instantiation. |
static void |
unauthorize(java.lang.Class<? extends org.apache.wicket.Component> componentClass,
java.lang.String roles)
Removes permission for the given roles to create instances of the given component class. |
static void |
unauthorize(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action,
java.lang.String roles)
Removes permission for the given role to perform the given action on the given component. |
static void |
unauthorizeAll(java.lang.Class<? extends org.apache.wicket.Component> componentClass)
Grants authorization to instantiate the given class to just the role NO_ROLE, effectively denying all other roles. |
static void |
unauthorizeAll(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action)
Grants authorization to perform the given action to just the role NO_ROLE, effectively denying all other roles. |
| Methods inherited from class org.apache.wicket.authorization.strategies.role.AbstractRoleAuthorizationStrategy |
|---|
hasAny, isEmpty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.wicket.MetaDataKey<org.apache.wicket.authorization.strategies.role.metadata.ActionPermissions> ACTION_PERMISSIONS
public static final org.apache.wicket.MetaDataKey<InstantiationPermissions> INSTANTIATION_PERMISSIONS
public static final java.lang.String NO_ROLE
| Constructor Detail |
|---|
public MetaDataRoleAuthorizationStrategy(IRoleCheckingStrategy roleCheckingStrategy)
roleCheckingStrategy - the authorizer object| Method Detail |
|---|
public static final void authorize(java.lang.Class<? extends org.apache.wicket.Component> componentClass,
java.lang.String roles)
componentClass - The component type that is subject for the authorizationroles - The comma separated roles that are authorized to create component instances of
type componentClass
public static final void authorize(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action,
java.lang.String roles)
component - The component that is subject to the authorizationaction - The action to authorizeroles - The comma separated roles to authorizepublic static final void authorizeAll(java.lang.Class<? extends org.apache.wicket.Component> componentClass)
componentClass - The component class
public static final void authorizeAll(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action)
component - The component that is subject to the authorizationaction - The action to authorize
public static final void unauthorize(java.lang.Class<? extends org.apache.wicket.Component> componentClass,
java.lang.String roles)
componentClass - The component typeroles - The comma separated list of roles that are no longer to be authorized to create
instances of type componentClass
public static final void unauthorize(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action,
java.lang.String roles)
component - The componentaction - The actionroles - The comma separated list of roles that are no longer allowed to perform the given
actionpublic static final void unauthorizeAll(java.lang.Class<? extends org.apache.wicket.Component> componentClass)
componentClass - The component class
public static final void unauthorizeAll(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action)
component - the component that is subject to the authorizationaction - the action to authorize
public boolean isActionAuthorized(org.apache.wicket.Component component,
org.apache.wicket.authorization.Action action)
IAuthorizationStrategy.isActionAuthorized(org.apache.wicket.Component,
org.apache.wicket.authorization.Action)public boolean isInstantiationAuthorized(java.lang.Class componentClass)
IAuthorizationStrategy.isInstantiationAuthorized(java.lang.Class)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||