Module org.apache.wicket.auth.roles
Class InstantiationPermissions
java.lang.Object
org.apache.wicket.authroles.authorization.strategies.role.metadata.InstantiationPermissions
- All Implemented Interfaces:
Serializable
,IClusterable
An internal data structure that maps a given component class to a set of role strings.
Permissions can be granted to instantiate a given component class via authorize(Class, Roles
roles) and denied via unauthorize(Class, Roles roles). All authorization can be removed for a
given class with authorizeAll(Class).
- Author:
- Eelco Hillenius, Jonathan Locke
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends Component>
voidGives the given role permission to instantiate the given class.final <T extends Component>
voidauthorizeAll
(Class<T> componentClass) Gives all roles permission to instantiate the given class.<T extends IRequestableComponent>
RolesauthorizedRoles
(Class<T> componentClass) Gets the roles that have a binding with the given component class.final <T extends Component>
voidunauthorize
(Class<T> componentClass, Roles rolesToRemove) Removes permission for the given role to instantiate the given class.
-
Constructor Details
-
InstantiationPermissions
public InstantiationPermissions()
-
-
Method Details
-
authorize
Gives the given role permission to instantiate the given class.- Type Parameters:
T
-- Parameters:
componentClass
- The component classrolesToAdd
- The roles to add
-
authorizeAll
Gives all roles permission to instantiate the given class. Note that this is only relevant if a role was previously authorized for that class. If no roles where previously authorized the effect of the unauthorize call is that no roles at all will be authorized for that class.- Type Parameters:
T
-- Parameters:
componentClass
- The component class
-
authorizedRoles
Gets the roles that have a binding with the given component class.- Type Parameters:
T
-- Parameters:
componentClass
- the component class- Returns:
- the roles that have a binding with the given component class, or null if no entries are found
-
unauthorize
Removes permission for the given role to instantiate the given class.- Type Parameters:
T
-- Parameters:
componentClass
- The classrolesToRemove
- The role to deny
-
getRolesForComponentClass
- Returns:
- gets map with roles objects for a component classes
-