Class PermissionController

java.lang.Object
edu.ucsb.nceas.metacat.PermissionController

public class PermissionController extends Object
  • Constructor Details

    • PermissionController

      public PermissionController(String myDocid) throws McdbException
      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

      public boolean hasPermission(String sessionId, String myPermission) throws SQLException
      Throws:
      SQLException
    • hasPermission

      public boolean hasPermission(String user, String[] groups, String myPermission) throws SQLException
      Check from db connection if at least one of the list of @principals Administrators are allowed all permission
      Parameters:
      user - the user name
      groups - the groups which the use is in
      myPermission - 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 table
      user - , the name of user
      groups - , 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 table
      user - , the name of user
      groups - , the group which the user belong to
      Throws:
      Exception