Package edu.ucsb.nceas.metacat
Class PermissionController
java.lang.Object
edu.ucsb.nceas.metacat.PermissionController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetUnReadableInlineDataIdList
(String docid, String user, String[] groups) A static method to get Hashtable which cointains a inlinedata object list that user can't read it.getUnWritableInlineDataIdList
(String docidWithoutRev, String user, String[] groups, boolean withRevision) A static method to get Hashtable which cointains a inline data object list that user can't overwrite it.boolean
hasPermission
(String sessionId, String myPermission) boolean
hasPermission
(String user, String[] groups, String myPermission) Check from db connection if at least one of the list of @principals Administrators are allowed all permissionboolean
Return if a document has subtree access control
-
Constructor Details
-
PermissionController
Constructor for PermissionController- Parameters:
myDocid
- the docid need to access- Throws:
McdbException
-
-
Method Details
-
hasSubTreeAccessControl
public boolean hasSubTreeAccessControl()Return if a document has subtree access control -
hasPermission
- Throws:
SQLException
-
hasPermission
Check from db connection if at least one of the list of @principals Administrators are allowed all permission- Parameters:
user
- the user namegroups
- the groups which the use is inmyPermission
- permission type to check for- Throws:
SQLException
-
getUnReadableInlineDataIdList
public static Hashtable<String,String> getUnReadableInlineDataIdList(String docid, String user, String[] groups) throws McdbException A static method to get Hashtable which cointains a inlinedata object list that user can't read it. The key is subtree id of inlinedata, the data is internal file name for the inline data which is stored as docid in xml_access table or data object doc id.- Parameters:
docid
- (With Rev), metadata docid which should be the accessfileid in the tableuser
- , the name of usergroups
- , the group which the user belong to- Throws:
McdbException
-
getUnWritableInlineDataIdList
public static Hashtable<String,String> getUnWritableInlineDataIdList(String docidWithoutRev, String user, String[] groups, boolean withRevision) throws Exception A static method to get Hashtable which cointains a inline data object list that user can't overwrite it. The key is subtree id of inline data distrubition, the value is internal file name for the inline data which is stored as docid in xml_access table or data object doc id.- Parameters:
docidWithoutRev
- , metadata docid which should be the accessfileid in the tableuser
- , the name of usergroups
- , the group which the user belong to- Throws:
Exception
-