com.flexive.shared.security
Enum Role

java.lang.Object
  extended by java.lang.Enum<Role>
      extended by com.flexive.shared.security.Role
All Implemented Interfaces:
ObjectWithColor, ObjectWithLabel, SelectableObject, SelectableObjectWithLabel, SelectableObjectWithName, java.io.Serializable, java.lang.Comparable<Role>

public enum Role
extends java.lang.Enum<Role>
implements SelectableObjectWithName, SelectableObjectWithLabel, ObjectWithColor, java.io.Serializable

User roles

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Enum Constant Summary
AccountManagement
          may CRUD users, groups and roles (may only add roles he is assigned himself, may not alter assigned roles that he has not assigned himself) for "his" mandator
ACLManagement
          may CRUD ACLs for "his" mandator
BackendAccess
          may login to the backend (does not imply any rights)
GlobalSupervisor
          Global Supervisor - no restrictions at all
MandatorSupervisor
          Mandator Supervisor - may do everything for "his" mandator
RestApiAccess
          may access the REST-API via tokens
ScriptExecution
          may execute scripts of type FxScriptEvent.Manual
ScriptManagement
          may CRUD scripts
SelectListEditor
          may see the user interface to edit selectlist items (role entitles to no CRUD rights!), actual permissions are taken from the select lists createItemACL
StructureManagement
          may CRUD types/relations/groups/properties/assignments/selectlists and assign scripts to structures for "his" mandator
WorkflowManagement
          may CRUD steps and workflows for "his" mandator
 
Method Summary
static java.util.List<Role> fromIdList(java.util.List<java.lang.Long> list)
           
static Role getById(long roleId)
          Returns a role identified by its unique id.
 java.lang.String getColor()
          Returns the color of the role.
 long getId()
          Returns the unique id of the role.
 FxString getLabel()
          Return the localized label of the object.
static java.util.List<Role> getList()
          Get all roles as a List
 java.lang.String getName()
          Return the description of the role.
static boolean isUndefined(long roleId)
          Check if the given role id is undefined
static java.lang.Long[] toIdArray(java.util.List<Role> roles)
          Convert a Role List to a Long id array
static java.lang.Long[] toIdArray(Role[] roles)
          Convert a Role array to a Long id array
static java.util.List<java.lang.Long> toIdList(java.util.List<Role> roles)
           
static long[] toPrimitiveIdArray(Role[] roles)
          Convert a Role array to a long id array
 java.lang.String toString()
          Returns a string representation of the role.
static Role valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Role[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GlobalSupervisor

public static final Role GlobalSupervisor
Global Supervisor - no restrictions at all


MandatorSupervisor

public static final Role MandatorSupervisor
Mandator Supervisor - may do everything for "his" mandator


ACLManagement

public static final Role ACLManagement
may CRUD ACLs for "his" mandator


AccountManagement

public static final Role AccountManagement
may CRUD users, groups and roles (may only add roles he is assigned himself, may not alter assigned roles that he has not assigned himself) for "his" mandator


SelectListEditor

public static final Role SelectListEditor
may see the user interface to edit selectlist items (role entitles to no CRUD rights!), actual permissions are taken from the select lists createItemACL


WorkflowManagement

public static final Role WorkflowManagement
may CRUD steps and workflows for "his" mandator


StructureManagement

public static final Role StructureManagement
may CRUD types/relations/groups/properties/assignments/selectlists and assign scripts to structures for "his" mandator


ScriptManagement

public static final Role ScriptManagement
may CRUD scripts


ScriptExecution

public static final Role ScriptExecution
may execute scripts of type FxScriptEvent.Manual


BackendAccess

public static final Role BackendAccess
may login to the backend (does not imply any rights)


RestApiAccess

public static final Role RestApiAccess
may access the REST-API via tokens

Method Detail

values

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

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

valueOf

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

isUndefined

public static boolean isUndefined(long roleId)
Check if the given role id is undefined

Parameters:
roleId - role id to check
Returns:
if undefined

getList

public static java.util.List<Role> getList()
Get all roles as a List

Returns:
roles as List

toIdList

public static java.util.List<java.lang.Long> toIdList(java.util.List<Role> roles)

fromIdList

public static java.util.List<Role> fromIdList(java.util.List<java.lang.Long> list)

getById

public static Role getById(long roleId)
Returns a role identified by its unique id.

Parameters:
roleId - the id of the role to fetch
Returns:
the role, or null if the id is not defined

getName

public java.lang.String getName()
Return the description of the role.

Specified by:
getName in interface SelectableObjectWithName
Returns:
the description of the role

getId

public long getId()
Returns the unique id of the role.

Specified by:
getId in interface SelectableObject
Returns:
the unique id of the role

getColor

public java.lang.String getColor()
Returns the color of the role.

Specified by:
getColor in interface ObjectWithColor
Returns:
the color of the role.

toString

public java.lang.String toString()
Returns a string representation of the role.

Overrides:
toString in class java.lang.Enum<Role>
Returns:
a string representation of the role

getLabel

public FxString getLabel()
Return the localized label of the object.

Specified by:
getLabel in interface ObjectWithLabel
Returns:
the localized label for the object.

toPrimitiveIdArray

public static long[] toPrimitiveIdArray(Role[] roles)
Convert a Role array to a long id array

Parameters:
roles - roles
Returns:
id's

toIdArray

public static java.lang.Long[] toIdArray(Role[] roles)
Convert a Role array to a Long id array

Parameters:
roles - roles
Returns:
id's

toIdArray

public static java.lang.Long[] toIdArray(java.util.List<Role> roles)
Convert a Role List to a Long id array

Parameters:
roles - roles
Returns:
id's