|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.access.MCRAccessBaseImpl
org.mycore.access.mcrimpl.MCRAccessControlSystem
public class MCRAccessControlSystem
MyCoRe-Standard Implementation of the MCRAccessInterface Maps object ids to rules
| Field Summary | |
|---|---|
(package private) MCRAccessStore |
accessStore
|
(package private) static MCRCache |
cache
|
(package private) boolean |
disabled
|
(package private) MCRAccessRule |
dummyRule
|
static String |
lexicographicalPattern
|
static String |
poolPrivilegeID
|
(package private) static Hashtable<String,String> |
ruleIDTable
|
(package private) MCRRuleStore |
ruleStore
|
(package private) static String |
superuserID
|
static String |
systemRulePrefix
|
| Fields inherited from class org.mycore.access.MCRAccessBaseImpl |
|---|
AccessPermissions, LOGGER |
| Method Summary | |
|---|---|
void |
addRule(String permission,
Element rule,
String description)
adds an access rule for an "a priori-permission" like "create-document" |
void |
addRule(String id,
String pool,
Element rule,
String description)
adds an access rule for an ID to an access system. |
boolean |
checkAccess(String objID,
String permission,
MCRUser user,
MCRIPAddress ip)
Validator methods to validate access definition for given object and pool |
boolean |
checkPermission(Element rule)
determines whether the current user has the permission to perform a certain action. |
boolean |
checkPermission(String permission)
determines whether the current user has the permission to perform a certain action. |
boolean |
checkPermission(String permission,
MCRUser user)
determines whether a given user has the permission to perform a certain action. |
boolean |
checkPermission(String id,
String permission)
determines whether the current user has the permission to perform a certain action. |
boolean |
checkPermission(String id,
String permission,
MCRUser user)
determines whether a given user has the permission to perform a certain action. |
void |
createRule(Element rule,
String creator,
String description)
create an access rule in the rulestore using an rule string in plain text |
void |
createRule(String ruleString,
String creator,
String description)
create an access rule in the rulestore using an rule string in plain text |
MCRAccessRule |
getAccess(String objID,
String pool)
|
Collection<String> |
getAllControlledIDs()
lists all String IDs, a permission is assigned to. |
MCRRuleMapping |
getAutoGeneratedRuleMapping(Element rule,
String creator,
String pool,
String id,
String description)
returns a auto-generated MCRRuleMapping, needed to create Access Definitions |
static MCRCache |
getCache()
|
String |
getNextFreeRuleID(String prefix)
method that delivers the next free ruleID for a given Prefix and sets the counter to counter + 1 |
String |
getNormalizedRuleString(Element rule)
delivers the rule as string, after normalizing it via sorting with MCRAccessConditionsComparator |
Collection<String> |
getPermissions()
lists all a-priori permissions like "create-document". |
Collection<String> |
getPermissionsForID(String objid)
lists all permissions defined for the id. |
Element |
getRule(String permission)
exports a access rule for a "a priori permission" as JDOM element. |
Element |
getRule(String objID,
String permission)
exports a access rule as JDOM element. |
String |
getRuleDescription(String permission)
returns the prosa description of a defined rule for a "a priori" permission like "create-document". |
String |
getRuleDescription(String objID,
String permission)
returns the prosa description of a defined rule. |
boolean |
hasRule(String id)
checks wether a rule with the id is defined. |
boolean |
hasRule(String id,
String permission)
checks wether a rule with the id and permission is defined. |
static MCRAccessInterface |
instance()
|
boolean |
isDisabled()
|
Element |
normalize(Element rule)
method, that normalizes the jdom-representation of a mycore access condition |
void |
removeAllRules(String id)
removes all rules of the id. |
void |
removeRule(String permission)
removes a rule for an "a priori permission" like "create-document" |
void |
removeRule(String id,
String pool)
removes a rule. |
void |
updateRule(String permission,
Element rule,
String description)
updates an access rule for an "a priori permission" of an access system like "create-document". |
void |
updateRule(String id,
String pool,
Element rule,
String description)
updates an access rule for an ID to an access system. |
| Methods inherited from class org.mycore.access.MCRAccessBaseImpl |
|---|
getAccessPermissionsFromConfiguration |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String systemRulePrefix
public static final String poolPrivilegeID
public static final String lexicographicalPattern
static String superuserID
static MCRCache cache
MCRAccessStore accessStore
MCRRuleStore ruleStore
MCRAccessRule dummyRule
boolean disabled
static Hashtable<String,String> ruleIDTable
| Method Detail |
|---|
public static MCRAccessInterface instance()
public void createRule(String ruleString,
String creator,
String description)
MCRAccessInterface
createRule in interface MCRAccessInterfacecreateRule in class MCRAccessBaseImplruleString - the rule string in plain textdescription - a String description of the rule in prosa
public void createRule(Element rule,
String creator,
String description)
MCRAccessInterface
createRule in interface MCRAccessInterfacecreateRule in class MCRAccessBaseImplrule - the rule string as xmldescription - a String description of the rule in prosa
public void addRule(String id,
String pool,
Element rule,
String description)
throws MCRException
MCRAccessInterfaceid serves as an identifier for the concrete underlying
rule, e.g. a MCRObjectID.
addRule in interface MCRAccessInterfaceaddRule in class MCRAccessBaseImplid - the ID-String of the objectpool - the access permission for the rulerule - the access ruledescription - a String description of the rule in prosa
MCRException - if an error occured
public void addRule(String permission,
Element rule,
String description)
MCRAccessInterface
addRule in interface MCRAccessInterfaceaddRule in class MCRAccessBaseImplpermission - the access permission for the rule (e.g. "create-document")rule - the access ruledescription - a String description of the rule in prosa
public void removeRule(String id,
String pool)
throws MCRException
MCRAccessInterfaceid serves as an identifier
for the concrete underlying rule, e.g. a MCRObjectID.
removeRule in interface MCRAccessInterfaceremoveRule in class MCRAccessBaseImplid - the ID-String of the objectpool - the access permission for the rule
MCRException - if an error occured
public void removeRule(String permission)
throws MCRException
MCRAccessInterface
removeRule in interface MCRAccessInterfaceremoveRule in class MCRAccessBaseImplpermission - the access permission for the rule
MCRException - if an error occured
public void removeAllRules(String id)
throws MCRException
MCRAccessInterfaceid. The parameter
id serves as an identifier for the concrete underlying
rule, e.g. a MCRObjectID.
removeAllRules in interface MCRAccessInterfaceremoveAllRules in class MCRAccessBaseImplid - the ID-String of the object
MCRException - if an errow was occured
public void updateRule(String id,
String pool,
Element rule,
String description)
throws MCRException
MCRAccessInterfaceid serves as an identifier for the concrete underlying
rule, e.g. a MCRObjectID.
updateRule in interface MCRAccessInterfaceupdateRule in class MCRAccessBaseImplid - the ID-String of the objectpool - the access permission for the rulerule - the access ruledescription - a String description of the rule in prosa
MCRException - if an errow was occured
public void updateRule(String permission,
Element rule,
String description)
throws MCRException
MCRAccessInterface
updateRule in interface MCRAccessInterfaceupdateRule in class MCRAccessBaseImplpermission - the access permission for the rulerule - the access ruledescription - a String description of the rule in prosa
MCRException - if an errow was occured
public boolean checkPermission(String id,
String permission)
MCRAccessInterfaceMCRSession instance which can be retrieved by
MCRSession currentSession = MCRSessionMgr.getCurrentSession();The parameter
id serves as an identifier for the concrete
underlying rule, e.g. a MCRObjectID.
checkPermission in interface MCRAccessInterfacecheckPermission in class MCRAccessBaseImplid - the ID-String of the objectpermission - the permission/action to be granted, e.g. "read"
MCRSessionMgr.getCurrentSession(),
MCRSession
public boolean checkPermission(String id,
String permission,
MCRUser user)
MCRAccessInterfaceid serves as an identifier for the concrete
underlying rule, e.g. a MCRObjectID.
checkPermission in interface MCRAccessInterfacecheckPermission in class MCRAccessBaseImplid - the ID-String of the objectpermission - the permission/action to be granted, e.g. "read"user - the MCRUser, whose permissions are checked
MCRSessionMgr.getCurrentSession(),
MCRSessionpublic boolean checkPermission(String permission)
MCRAccessInterfaceMCRSession instance which can be retrieved by
MCRSession currentSession = MCRSessionMgr.getCurrentSession();This method is used for checking "a priori permissions" like "create-document" where a String ID does not exist yet
checkPermission in interface MCRAccessInterfacecheckPermission in class MCRAccessBaseImplpermission - the permission/action to be granted, e.g. "create-document"
MCRSessionMgr.getCurrentSession(),
MCRSession
public boolean checkPermission(String permission,
MCRUser user)
MCRAccessInterface
checkPermission in interface MCRAccessInterfacecheckPermission in class MCRAccessBaseImplpermission - the permission/action to be granted, e.g. "create-document"user - the MCRUser, whose permissions are checked
MCRSessionMgr.getCurrentSession(),
MCRSessionpublic boolean checkPermission(Element rule)
MCRAccessInterfaceMCRSession instance which can be retrieved by
MCRSession currentSession = MCRSessionMgr.getCurrentSession();
checkPermission in interface MCRAccessInterfacecheckPermission in class MCRAccessBaseImplrule - the jdom-representation of a mycore access rule
MCRSessionMgr.getCurrentSession(),
MCRSession
public Element getRule(String objID,
String permission)
MCRAccessInterface
getRule in interface MCRAccessInterfacegetRule in class MCRAccessBaseImplobjID - the ID-String of the objectpermission - the access permission for the rule
null if no rule is
definedpublic Element getRule(String permission)
MCRAccessInterface
getRule in interface MCRAccessInterfacegetRule in class MCRAccessBaseImplpermission - the access permission for the rule
null if no rule is
definedpublic String getRuleDescription(String permission)
MCRAccessInterface
getRuleDescription in interface MCRAccessInterfacegetRuleDescription in class MCRAccessBaseImplpermission - the access permission for the rule
public String getRuleDescription(String objID,
String permission)
MCRAccessInterface
getRuleDescription in interface MCRAccessInterfacegetRuleDescription in class MCRAccessBaseImplobjID - the ID-String of the objectpermission - the access permission for the rule
public Collection<String> getPermissionsForID(String objid)
MCRAccessInterfaceid.
The parameter id serves as an identifier for the concrete
underlying rule, e.g. a MCRObjectID.
getPermissionsForID in interface MCRAccessInterfacegetPermissionsForID in class MCRAccessBaseImplList of all for id defined
permissionpublic Collection<String> getPermissions()
MCRAccessInterface
getPermissions in interface MCRAccessInterfacegetPermissions in class MCRAccessBaseImplList of all defined permissions
public boolean hasRule(String id,
String permission)
MCRAccessBaseImpl
(getRule(id, permission)!=null);
hasRule in interface MCRAccessInterfacehasRule in class MCRAccessBaseImplid - the ID-String of the objectpermission - the access permission for the rule
MCRAccessBaseImpl.getRule(String, String)public boolean hasRule(String id)
MCRAccessBaseImpl
(getPermissionsForID(id).size()>0);
hasRule in interface MCRAccessInterfacehasRule in class MCRAccessBaseImplid - the ID-String of the object
MCRAccessBaseImpl.getRule(String, String)public Collection<String> getAllControlledIDs()
MCRAccessInterfaceid serves as an identifier for the concrete
underlying rule, e.g. a MCRObjectID.
getAllControlledIDs in interface MCRAccessInterfacegetAllControlledIDs in class MCRAccessBaseImplList of all String IDspublic boolean isDisabled()
public MCRAccessRule getAccess(String objID,
String pool)
public boolean checkAccess(String objID,
String permission,
MCRUser user,
MCRIPAddress ip)
permission - poolname as stringobjID - MCRObjectID as stringuser - MCRUserip - ip-Address
public String getNextFreeRuleID(String prefix)
prefix - String
public String getNormalizedRuleString(Element rule)
getNormalizedRuleString in interface MCRAccessInterfacegetNormalizedRuleString in class MCRAccessBaseImplrule - Jdom-Element
public MCRRuleMapping getAutoGeneratedRuleMapping(Element rule,
String creator,
String pool,
String id,
String description)
rule - JDOM-Representation of a MCRAccess Rulecreator - Stringpool - Stringid - String
public Element normalize(Element rule)
rule - condition-JDOM of an access-rule
public static MCRCache getCache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||