Package org.mycore.access.facts
Class MCRFactsAccessSystem
java.lang.Object
org.mycore.access.facts.MCRFactsAccessSystem
- All Implemented Interfaces:
MCRAccessInterface
,MCRAccessCheckStrategy
@Singleton
public class MCRFactsAccessSystem
extends Object
implements MCRAccessInterface, MCRAccessCheckStrategy
base class for XML fact based access system
enabled it with the 2 properties:
MCR.Access.Class=org.mycore.access.facts.MCRFactsAccessSystem
MCR.Access.Strategy.Class=org.mycore.access.facts.MCRFactsAccessSystem
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkPermission
(String permission) determines whether the current 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 checkID, String permission, List<MCRFact> baseFacts) boolean
checkPermission
(String checkID, String permission, MCRUserInformation userInfo) determines whether a given user has the permission to perform a certain action. no session data will be checked here.boolean
checkPermissionForUser
(String permission, MCRUserInformation userInfo) determines whether a given user has the permission to perform a certain action. no session data will be checked here.void
void
setProperties
(Map<String, String> properties) void
setRulesURI
(String uri)
-
Field Details
-
LOGGER
-
-
Constructor Details
-
MCRFactsAccessSystem
public MCRFactsAccessSystem()
-
-
Method Details
-
init
-
setRulesURI
-
getProperties
-
setProperties
-
checkPermission
Description copied from interface:MCRAccessInterface
determines whether the current user has the permission to perform a certain action.- Specified by:
checkPermission
in interfaceMCRAccessCheckStrategy
- Specified by:
checkPermission
in interfaceMCRAccessInterface
- 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:
-
checkPermissionForUser
Description copied from interface:MCRAccessInterface
determines whether a given user has the permission to perform a certain action. no session data will be checked here. This method is used for checking "a priori permissions" like "create-document" where a String ID does not exist yet- Specified by:
checkPermissionForUser
in interfaceMCRAccessInterface
- Parameters:
permission
- the permission/action to be granted, e.g. "create-document"userInfo
- the MCRUser, whose permissions are checked- Returns:
- true if the permission is granted, else false
-
checkPermission
-
checkPermission
Description copied from interface:MCRAccessInterface
determines whether a given user has the permission to perform a certain action. no session data will be checked here. The parameterid
serves as an identifier for the concrete underlying rule, e.g. a MCRObjectID.- Specified by:
checkPermission
in interfaceMCRAccessInterface
- Parameters:
checkID
- the ID-String of the objectpermission
- the permission/action to be granted, e.g. "read"userInfo
- the MCRUser, whose permissions are checked- Returns:
- true if the permission is granted, else false
-
checkPermission
Description copied from interface:MCRAccessInterface
determines whether the current user has the permission to perform a certain action. All information regarding the current user is capsulated by aMCRSession
instance which can be retrieved byMCRSession currentSession = MCRSessionMgr.getCurrentSession();
This method is used for checking "a priori permissions" like "create-document" where a String ID does not exist yet- Specified by:
checkPermission
in interfaceMCRAccessInterface
- Parameters:
permission
- the permission/action to be granted, e.g. "create-document"- Returns:
- true if the permission is granted, else false
- See Also:
-