toUserRole method

UserRole toUserRole()

Implementation

UserRole toUserRole() {
  switch (this) {
    case 'ADMIN':
      return UserRole.admin;
    case 'AUTHOR':
      return UserRole.author;
    case 'READER':
      return UserRole.reader;
    case 'RESTRICTED_AUTHOR':
      return UserRole.restrictedAuthor;
    case 'RESTRICTED_READER':
      return UserRole.restrictedReader;
  }
  throw Exception('$this is not known in enum UserRole');
}