Enum Class Role

java.lang.Object
java.lang.Enum<Role>
inha.dayoook_e.user.domain.enums.Role
All Implemented Interfaces:
Serializable, Comparable<Role>, Constable

public enum Role extends Enum<Role>
Role 열거형은 사용자 역할을 정의. 각 역할은 해당 역할에 부여된 권한 세트를 가짐.
  • Enum Constant Details

    • TUTEE

      public static final Role TUTEE
    • ADMIN

      public static final Role ADMIN
    • TUTOR

      public static final Role TUTOR
  • Method Details

    • values

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

      public static Role valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getAuthorities

      public List<org.springframework.security.core.authority.SimpleGrantedAuthority> getAuthorities()
      역할에 해당하는 권한 리스트를 반환.

      권한은 SimpleGrantedAuthority 객체로 변환.

      Returns:
      역할에 해당하는 권한 리스트