edu.ucsb.nceas.metacat
Class PermissionController

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.PermissionController

public class PermissionController
extends java.lang.Object


Constructor Summary
PermissionController(java.lang.String myDocid)
          Constructor for PermissionController
 
Method Summary
 boolean hasPermission(java.lang.String user, java.lang.String[] groups, java.lang.String myPermission)
          Check from db connection if at least one of the list of @principals
 boolean hasPermissionForSubTreeNode(java.lang.String user, java.lang.String[] groups, java.lang.String myPermission, long nodeId)
          The method to determine of a node can be access by a user just by subtree access control
 boolean hasSubTreeAccessControl()
          Return if a document has subtree access control
 java.util.Hashtable hasUnaccessableSubTree(java.lang.String user, java.lang.String[] groups, java.lang.String myPermission)
          This method will return a hasTable of subtree which user doesn't has the permssion to access
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionController

public PermissionController(java.lang.String myDocid)
                     throws McdbException
Constructor for PermissionController

Parameters:
myDocid - the docid need to access
Method Detail

hasSubTreeAccessControl

public boolean hasSubTreeAccessControl()
Return if a document has subtree access control


hasPermission

public boolean hasPermission(java.lang.String user,
                             java.lang.String[] groups,
                             java.lang.String myPermission)
                      throws java.sql.SQLException,
                             java.lang.Exception
Check from db connection if at least one of the list of @principals

Parameters:
user - the user name
groups - the groups which the use is in
myPermission - permission type to check for
java.sql.SQLException
java.lang.Exception

hasPermissionForSubTreeNode

public boolean hasPermissionForSubTreeNode(java.lang.String user,
                                           java.lang.String[] groups,
                                           java.lang.String myPermission,
                                           long nodeId)
                                    throws McdbException
The method to determine of a node can be access by a user just by subtree access control

McdbException

hasUnaccessableSubTree

public java.util.Hashtable hasUnaccessableSubTree(java.lang.String user,
                                                  java.lang.String[] groups,
                                                  java.lang.String myPermission)
                                           throws McdbException
This method will return a hasTable of subtree which user doesn't has the permssion to access

Parameters:
user - the user name
groups - the groups which the use is in
myPermission - permission type to check for
McdbException


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.