Package org.mycore.access.strategies
Class MCRCreatorRuleStrategy
java.lang.Object
org.mycore.access.strategies.MCRCreatorRuleStrategy
- All Implemented Interfaces:
MCRAccessCheckStrategy
,MCRCombineableAccessCheckStrategy
First, a check is done if the user is in the submitter role, if the user is the creator of the object and if the
creator ist permitted to perform the requested action in the object's current state (two groups of states, submitted,
and review, are checked). If not it will be tried to check the permission against the rule ID
default_<ObjectType>
if it exists. If not the last
fallback is done against default
.
Specify classification and category for submitted and review states:
MCR.Access.Strategy.SubmittedCategories=state:submitted
MCR.Access.Strategy.ReviewCategories=state:review
Specify permissions for submitted and review states:
MCR.Access.Strategy.CreatorSubmittedPermissions=writedb,deletedb
MCR.Access.Strategy.CreatorReviewPermissions=read
You can also specify a comma separated list of categories like: state:submitted,state:new
- Version:
- $Revision$ $Date$
- Author:
- Thomas Scheffler (yagee), Kathleen Neumann (mcrkrebs)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkPermission
(String id, String permission) determines whether the current user has the permission to perform a certain action.boolean
hasRuleMapping
(String id, String permission) Checks if this strategy has a rule mapping defined.boolean
isCreatorRuleAvailable
(String id, String permission)
-
Constructor Details
-
MCRCreatorRuleStrategy
public MCRCreatorRuleStrategy()
-
-
Method Details
-
checkPermission
Description copied from interface:MCRAccessCheckStrategy
determines whether the current user has the permission to perform a certain action.- Specified by:
checkPermission
in interfaceMCRAccessCheckStrategy
- Parameters:
id
- the MCRObjectID of the objectpermission
- the access permission for the rule- Returns:
- true if the access is allowed otherwise it return
- See Also:
-
hasRuleMapping
Description copied from interface:MCRCombineableAccessCheckStrategy
Checks if this strategy has a rule mapping defined. Can be used by other more complex strategies that require this information to decide if this strategy should be used.- Specified by:
hasRuleMapping
in interfaceMCRCombineableAccessCheckStrategy
- Parameters:
id
- a possible MCRObjectID of the object or any other "id"permission
- the access permission for the rule- Returns:
- true if there is a mapping to a rule defined
-
isCreatorRuleAvailable
-