Enum Class ActorRole
- All Implemented Interfaces:
Serializable, Comparable<ActorRole>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAnyone privileged with theActorAuthority.FACULTY_ADMINISTRATION.Director (head) of the Institute of Computer Science at the FMI.Assigned to the most important Actors.Person writing a doctoral dissertation in order to obtain a Doctor title.University professors.See Wikipedia.Regular university student.Associated with theActorAuthority.PRIVILEGED.Person not assigned anyActorRole. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull ActorRoleofActorAuthority(@NonNull ActorAuthority actorAuthority) Of those ActorRoles that correspond to the givenActorAuthority, returns that role with the lowest level of authority.Converts the given label to the matching enum value.@NonNull ActorAuthorityConverts this ActorRole to its correspondingActorAuthority:@NonNull org.springframework.security.core.GrantedAuthoritystatic ActorRoleReturns the enum constant of this class with the specified name.static ActorRole[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IT_ADMINISTRATOR
Assigned to the most important Actors. Associated with theActorAuthority.IT_ADMINISTRATION. -
DEAN
-
DIRECTOR
Director (head) of the Institute of Computer Science at the FMI. -
ADMINISTRATION
Anyone privileged with theActorAuthority.FACULTY_ADMINISTRATION. -
PROFESSOR
University professors. Associated with theActorAuthority.PRIVILEGED. -
RESEARCH_ASSISTANT
See Wikipedia. Associated with theActorAuthority.PRIVILEGED. -
TECHNICAL_EMPLOYEE
Associated with theActorAuthority.PRIVILEGED. -
PHD_CANDIDATE
Person writing a doctoral dissertation in order to obtain a Doctor title. Associated with theActorAuthority.PRIVILEGED. -
STUDENT
Regular university student. Associated with theActorAuthority.REGULAR. -
UNKNOWN
Person not assigned anyActorRole. Associated with theActorAuthority.REGULAR.
-
-
Field Details
-
role
-
-
Constructor Details
-
ActorRole
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
toActorAuthority
Converts this ActorRole to its corresponding
ActorAuthority:STUDENT,UNKNOWN:ActorAuthority.REGULAR- everyone else:
ActorAuthority.PRIVILEGED
- Returns:
- The ActorAuthority associated with this ActorRole.
-
toGrantedAuthority
@Contract(pure=true) @NonNull public @NonNull org.springframework.security.core.GrantedAuthority toGrantedAuthority()Creates a newSimpleGrantedAuthorityby prependingROLE_to thetoActorAuthority()result. This tells the Spring framework that theGrantedAuthorityis a role (see the documentation).- Returns:
- The GrantedAuthority representing this role.
-
ofName
-
ofActorAuthority
@Contract(pure=true) @NonNull public static @NonNull ActorRole ofActorAuthority(@NonNull @NonNull ActorAuthority actorAuthority) Of those ActorRoles that correspond to the givenActorAuthority, returns that role with the lowest level of authority.- Parameters:
actorAuthority- The authority for which to return an example role.- Returns:
- An example role for the given authority.
-