Class MCRAccessCommands

java.lang.Object
org.mycore.frontend.cli.MCRAbstractCommands
org.mycore.frontend.cli.MCRAccessCommands
All Implemented Interfaces:
MCRExternalCommandInterface

@MCRCommandGroup(name="Access Commands") public class MCRAccessCommands extends MCRAbstractCommands
This class provides a set of commands for the org.mycore.access management which can be used by the command line interface.
Version:
$Revision: 1.11 $ $Date: 2008/11/27 07:58:28 $
Author:
Heiko Helmbrecht, Jens Kupferschmidt
  • Constructor Details

    • MCRAccessCommands

      public MCRAccessCommands()
  • Method Details

    • createPermissionsFromFile

      public static void createPermissionsFromFile(String filename) throws Exception
      This method sets the new permissions given in a certain file
      Parameters:
      filename - the filename of the file that contains the mcrpermissions
      Throws:
      Exception
    • loadPermissionsFromFile

      @MCRCommand(syntax="load permissions data from file {0}", help="The command loads the permissions data of the access control system with data from the file {0}.", order=10) public static void loadPermissionsFromFile(String filename) throws Exception
      This method deletes the old permissions (if given any) and sets the new permissions given in a certain file
      Parameters:
      filename - the filename of the file that contains the mcrpermissions
      Throws:
      Exception
      See Also:
    • deleteAllPermissions

      @MCRCommand(syntax="delete all permissions", help="Remove all permission entries from the Access Control System.", order=40) public static void deleteAllPermissions() throws Exception
      delete all permissions
      Throws:
      Exception
    • deletePermission

      @MCRCommand(syntax="delete permission {0}", help="Remove a named permission entriy from the Access Control System.", order=30) public static void deletePermission(String permission) throws Exception
      delete the permission {0}
      Parameters:
      permission - the name of the permission
      Throws:
      Exception
    • listAllPermissions

      @MCRCommand(syntax="list all permissions", help="List all permission entries.", order=20) public static void listAllPermissions() throws MCRException
      This method invokes MCRUserMgr.getAllPrivileges() and retrieves a ArrayList of all privileges stored in the persistent datastore.
      Throws:
      MCRException
    • exportAllPermissionsToFile

      @MCRCommand(syntax="export all permissions to file {0}", help="Export all permissions from the Access Control System to the file {0}.", order=50) public static void exportAllPermissionsToFile(String filename) throws Exception
      This method just export the permissions to a file
      Parameters:
      filename - the file written to
      Throws:
      Exception
    • permissionUpdateForID

      @MCRCommand(syntax="update permission {0} for id {1} with rulefile {2}", help="The command updates access rule for a given id of a given permission with a given special rule", order=70) public static void permissionUpdateForID(String permission, String id, String strFileRule) throws Exception
      updates the permission for a given id and a given permission type with a given rule
      Parameters:
      permission - String type of permission like read, writedb, etc.
      id - String the id of the object the rule is assigned to
      strFileRule - String the path to the xml file, that contains the rule
      Throws:
      Exception
    • permissionUpdateForID

      @MCRCommand(syntax="update permission {0} for id {1} with rulefile {2} described by {3}", help="The command updates access rule for a given id of a given permission with a given special rule", order=60) public static void permissionUpdateForID(String permission, String id, String strFileRule, String description) throws Exception
      updates the permission for a given id and a given permission type with a given rule
      Parameters:
      permission - String type of permission like read, writedb, etc.
      id - String the id of the object the rule is assigned to
      strFileRule - String the path to the xml file, that contains the rule
      description - String give a special description, if the semantics of your rule is multiple used
      Throws:
      Exception
    • permissionUpdateForSelected

      @MCRCommand(syntax="update permission {0} for selected with rulefile {1}", help="The command updates access rule for a given permission and all ids of a given MCRObject-Type with a given special rule", order=90) public static void permissionUpdateForSelected(String permission, String strFileRule) throws Exception
      updates the permissions for all ids of a given MCRObjectID-Type with a given rule and a given permission
      Parameters:
      permission - String type of permission like read, writedb, etc.
      strFileRule - String the path to the xml file, that contains the rule
      Throws:
      Exception
    • permissionUpdateForSelected

      @MCRCommand(syntax="update permission {0} for selected with rulefile {1} described by {2}", help="The command updates access rule for a given permission and all ids of a given MCRObject-Type with a given special rule", order=80) public static void permissionUpdateForSelected(String permission, String strFileRule, String description) throws Exception
      updates the permissions for all ids of a given MCRObjectID-Type and for a given permission type with a given rule
      Parameters:
      permission - String type of permission like read, writedb, etc.
      strFileRule - String the path to the xml file, that contains the rule
      description - String give a special description, if the semantics of your rule is multiple used
      Throws:
      Exception
    • permissionDeleteForID

      @MCRCommand(syntax="delete permission {0} for id {1}", help="The command delete access rule for a given id of a given permission", order=110) public static void permissionDeleteForID(String permission, String id)
      delete a given permission for a given id
      Parameters:
      permission - String type of permission like read, writedb, etc.
      id - String the id of the object the rule is assigned to
    • permissionDeleteAllForID

      @MCRCommand(syntax="delete all permissions for id {1}", help="The command delete all access rules for a given id", order=120) public static void permissionDeleteAllForID(String id)
      delete all permissions for a given id
      Parameters:
      id - String the id of the object the rule is assigned to
    • permissionDeleteForSelected

      @MCRCommand(syntax="delete permission {0} for selected", help="The command delete access rule for a query selected set of object ids of a given permission", order=130) public static void permissionDeleteForSelected(String permission)
      delete all permissions for all selected objects
      Parameters:
      permission - String type of permission like read, writedb, etc.
      See Also:
    • permissionDeleteAllForSelected

      @MCRCommand(syntax="delete all permissions for selected", help="The command delete all access rules for a query selected set of object ids", order=140) public static void permissionDeleteAllForSelected()
      delete all permissions for all selected objects
      See Also:
    • setWebsiteReadOnly

      @MCRCommand(syntax="set website read only {0}", help="This command set the whole website into read only mode and provides the given message to users. Nobody, except super user can write on system, using web frontend. Parameter {0} specifies a message to be displayed", order=150) public static void setWebsiteReadOnly(String message)
    • setWebsiteReadOnly

      @MCRCommand(syntax="set website read only", help="This command set the whole website into read only mode. An already configurated message will be displayed to users. Nobody, except super user can write on system, using web frontend", order=160) public static void setWebsiteReadOnly()
    • unsetWebsiteReadOnly

      @MCRCommand(syntax="unset website read only", help="This command removes the write protection (read only) from website. After unsetting anybody can write as usual, using web frontend", order=170) public static void unsetWebsiteReadOnly()