gov.nih.nci.caarray.domain.permissions
Class Privileges

java.lang.Object
  extended by gov.nih.nci.caarray.domain.permissions.Privileges

public class Privileges
extends java.lang.Object

A simple class to hold the privileges a user may have for a Protectable object. Has methods to make it convenient to use in the view layer

Author:
dkokotov

Constructor Summary
Privileges()
          Create a new Privileges with no privilege names.
Privileges(java.util.List<java.lang.String> privilegeNames)
          Create a new Privileges with given privilege names.
 
Method Summary
 java.util.List<java.lang.String> getPrivilegeNames()
           
 boolean isBrowse()
           
 boolean isPartialRead()
           
 boolean isPartialWrite()
           
 boolean isPermissions()
           
 boolean isRead()
           
 boolean isWrite()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Privileges

public Privileges(java.util.List<java.lang.String> privilegeNames)
Create a new Privileges with given privilege names.

Parameters:
privilegeNames - privilege names

Privileges

public Privileges()
Create a new Privileges with no privilege names.

Method Detail

getPrivilegeNames

public java.util.List<java.lang.String> getPrivilegeNames()
Returns:
the names of the privileges in this object

isRead

public boolean isRead()
Returns:
whether this includes the READ privilege

isBrowse

public boolean isBrowse()
Returns:
whether this includes the BROWSE privilege

isWrite

public boolean isWrite()
Returns:
whether this includes the WRITE privilege

isPermissions

public boolean isPermissions()
Returns:
whether this includes the PERMISSIONS privilege

isPartialRead

public boolean isPartialRead()
Returns:
whether this includes the PARTIAL_READ privilege

isPartialWrite

public boolean isPartialWrite()
Returns:
whether this includes the PARTIAL_WRITE privilege