edu.jhu.tmaj.beans.data
Enum AdminAppPermission

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

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

Represents the 2 types of administrators: Group Admin and Full-Admin. Group Admins only have permission over a subset of users, projects, arrayblocks, and specimens. (All protected resources in tmaj are derived from one of those 4 things.)


Enum Constant Summary
FULL_ADMIN
           
GROUP_ADMIN
           
NONE
           
 
Method Summary
 int getDBValue()
          Returns the integer that is stored in the database representing this permission.
static AdminAppPermission getInstance(java.lang.Integer dbValue)
           
static java.lang.String[] getPermissionsArray()
           
 boolean isFullAdmin()
          Returns true if the user is a full ("true") admin.
 boolean isHigherAccess(AdminAppPermission permission)
           
 boolean mayAccessAdminApp()
          Returns true if the user can get into the administrator application.
static AdminAppPermission valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static AdminAppPermission[] 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 AdminAppPermission NONE

GROUP_ADMIN

public static final AdminAppPermission GROUP_ADMIN

FULL_ADMIN

public static final AdminAppPermission FULL_ADMIN
Method Detail

values

public static AdminAppPermission[] 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 (AdminAppPermission c : AdminAppPermission.values())
    System.out.println(c);

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

valueOf

public static AdminAppPermission 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

getDBValue

public int getDBValue()
Returns the integer that is stored in the database representing this permission.


getInstance

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

mayAccessAdminApp

public boolean mayAccessAdminApp()
Returns true if the user can get into the administrator application. Group admins can still get in, except they will not have access to all data inside.


isFullAdmin

public boolean isFullAdmin()
Returns true if the user is a full ("true") admin.


getPermissionsArray

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

isHigherAccess

public boolean isHigherAccess(AdminAppPermission permission)