Skip to content

Commit

Permalink
Added PRO role to fix attendee login
Browse files Browse the repository at this point in the history
  • Loading branch information
s0phialiu committed Feb 5, 2024
1 parent bc8947b commit b688949
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion HIAPI/Models/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public struct Roles: OptionSet, Codable {
public static let SPONSOR = Roles(rawValue: 1 << 4)
public static let STAFF = Roles(rawValue: 1 << 5)
public static let ADMIN = Roles(rawValue: 1 << 6)
public static let allRoles = ["USER", "APPLICANT", "ATTENDEE", "MENTOR", "SPONSOR", "STAFF", "ADMIN"]
public static let PRO = Roles(rawValue: 1 << 7)
public static let allRoles = ["USER", "APPLICANT", "ATTENDEE", "MENTOR", "SPONSOR", "STAFF", "ADMIN", "PRO"]

public init(rawValue: Int) {
self.rawValue = rawValue
Expand All @@ -59,6 +60,7 @@ public struct Roles: OptionSet, Codable {
case "SPONSOR": self = .SPONSOR
case "STAFF": self = .STAFF
case "ADMIN": self = .ADMIN
case "PRO": self = .PRO
default:
#if DEBUG
throw DecodingError.unknownOption
Expand All @@ -77,6 +79,7 @@ public struct Roles: OptionSet, Codable {
if contains(.SPONSOR) { try container.encode("SPONSOR") }
if contains(.STAFF) { try container.encode("STAFF") }
if contains(.ADMIN) { try container.encode("ADMIN") }
if contains(.PRO) { try container.encode("PRO") }
}
}

Expand Down

0 comments on commit b688949

Please sign in to comment.