Class MCRCreatorRuleStrategy

java.lang.Object
org.mycore.access.strategies.MCRCreatorRuleStrategy
All Implemented Interfaces:
MCRAccessCheckStrategy, MCRCombineableAccessCheckStrategy

public class MCRCreatorRuleStrategy extends Object implements 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 Details

    • MCRCreatorRuleStrategy

      public MCRCreatorRuleStrategy()
  • Method Details

    • checkPermission

      public boolean checkPermission(String id, String permission)
      Description copied from interface: MCRAccessCheckStrategy
      determines whether the current user has the permission to perform a certain action.
      Specified by:
      checkPermission in interface MCRAccessCheckStrategy
      Parameters:
      id - the MCRObjectID of the object
      permission - the access permission for the rule
      Returns:
      true if the access is allowed otherwise it return
      See Also:
    • hasRuleMapping

      public boolean hasRuleMapping(String id, String permission)
      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 interface MCRCombineableAccessCheckStrategy
      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

      public boolean isCreatorRuleAvailable(String id, String permission)