edu.jhu.tmaj.beans.data
Enum SpecimensAppPermission

java.lang.Object
  extended by java.lang.Enum<SpecimensAppPermission>
      extended by edu.jhu.tmaj.beans.data.SpecimensAppPermission
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SpecimensAppPermission>

public enum SpecimensAppPermission
extends java.lang.Enum<SpecimensAppPermission>

The permission level a user has for the Specimens Application.


Enum Constant Summary
ALL
           
NONE
           
OPEN
           
READ_ONLY
           
STANDARD
           
 
Method Summary
 int getDBValue()
           
static SpecimensAppPermission getInstance(java.lang.Integer dbValue)
           
static java.lang.String[] getPermissionsArray()
           
 boolean hasAllAccess()
          Returns true if the user should see every record in the database, regardless of which specimens they have been assigned to.
 boolean hasAtLeastOpenAccess()
          Returns true if a user will receive automatic access to 'requested' Specimens.
 boolean hasAtLeastReadAccess()
           
 boolean hasWritePermission()
          Returns false if the user may only view records, and not change them.
 boolean isHigherAccess(SpecimensAppPermission permission)
           
 boolean mayAccessSpecimensApplication()
          Returns true if a user may get into the Specimens App
static SpecimensAppPermission valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SpecimensAppPermission[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final SpecimensAppPermission NONE

READ_ONLY

public static final SpecimensAppPermission READ_ONLY

STANDARD

public static final SpecimensAppPermission STANDARD

OPEN

public static final SpecimensAppPermission OPEN

ALL

public static final SpecimensAppPermission ALL
Method Detail

values

public static SpecimensAppPermission[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SpecimensAppPermission c : SpecimensAppPermission.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SpecimensAppPermission valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getInstance

public static SpecimensAppPermission getInstance(java.lang.Integer dbValue)

getDBValue

public int getDBValue()

hasAllAccess

public boolean hasAllAccess()
Returns true if the user should see every record in the database, regardless of which specimens they have been assigned to. Users are assigned to Specimens in the UsersSpecimens table, but if this permission is set, the records in the table are irrelevant for that user. This is a feature that should be turned on for administrators.


hasAtLeastOpenAccess

public boolean hasAtLeastOpenAccess()
Returns true if a user will receive automatic access to 'requested' Specimens. A requested Specimen is a specimen that already exists in the database and that a user is trying to add. If the user does not have open access, they will receive an error saying this Specimen already exists and you do not have access. If the user has open access, the user will automatically receive permission for that specimen, block, or tissue diagnosis.


hasAtLeastReadAccess

public boolean hasAtLeastReadAccess()

mayAccessSpecimensApplication

public boolean mayAccessSpecimensApplication()
Returns true if a user may get into the Specimens App


hasWritePermission

public boolean hasWritePermission()
Returns false if the user may only view records, and not change them.


getPermissionsArray

public static java.lang.String[] getPermissionsArray()

isHigherAccess

public boolean isHigherAccess(SpecimensAppPermission permission)