Class MCRObjectTypeStrategy

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

public class MCRObjectTypeStrategy extends Object implements MCRCombineableAccessCheckStrategy
Use this class if you want to have a fallback to some default access rules. First a check is done for the MCRObjectID. If no rule for the ID is specified it will be tried to check the permission agains the rule ID default_<ObjectType> if it exists. If not the last fallback is done against default.
Version:
$Revision$ $Date$
Author:
Thomas Scheffler (yagee)
  • Constructor Details

    • MCRObjectTypeStrategy

      public MCRObjectTypeStrategy()
  • 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:
    • checkObjectTypePermission

      public static boolean checkObjectTypePermission(String id, String permission)
    • 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