com.sun.faban.harness.security
Class Acl

java.lang.Object
  extended by com.sun.faban.harness.security.Acl

public class Acl
extends Object

Acl is the encapsulation and caching of access control lists. These are represented as *.acl files in various Faban directories. The class provide several static methods for accessing the right ACLs.

Author:
Akara Sucharitakul

Method Summary
 boolean contains(Subject user)
          Checks whether the acl contains an identitity (a principal name) of the given subject.
static Acl getInstance(Permission perm, String resource)
          Obtains the acl instance for the given permission and resource.
static Acl[] getInstances(Permission perm)
          Obtains all acl instances for a certain permission.
 String getResource()
          Obtains the resource this ACL represents.
 boolean isEmpty()
          Checks whether the acl is empty.
static void merge(String[] resources, String targetResource)
          Merge analysis ACLs from source ACLs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstances

public static Acl[] getInstances(Permission perm)
Obtains all acl instances for a certain permission. This is used to check whether a user has access to such functionality at all.

Parameters:
perm - One of the Faban permissions
Returns:
All acl instances reflecting the permission.

getInstance

public static Acl getInstance(Permission perm,
                              String resource)
Obtains the acl instance for the given permission and resource.

Parameters:
perm - The permission to check
resource - The resource to check
Returns:
The acl instance pertaining to the resource and permission

getResource

public String getResource()
Obtains the resource this ACL represents.

Returns:
The resource name

isEmpty

public boolean isEmpty()
Checks whether the acl is empty. An empty acl usually means everybody is allowed.

Returns:
True if the acl is empty, false otherwise

contains

public boolean contains(Subject user)
Checks whether the acl contains an identitity (a principal name) of the given subject.

Parameters:
user - The subject representing the logged on user
Returns:
True if the acl contains at least one identity of the user

merge

public static void merge(String[] resources,
                         String targetResource)
Merge analysis ACLs from source ACLs.

Parameters:
resources - The resources, usually runs
targetResource - The resource for the analysis