From b6889492bd9a9b3da9dbfdfb1a19cef5c072046f Mon Sep 17 00:00:00 2001 From: Sophia Liu Date: Mon, 5 Feb 2024 10:12:19 -0600 Subject: [PATCH] Added PRO role to fix attendee login --- HIAPI/Models/User.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HIAPI/Models/User.swift b/HIAPI/Models/User.swift index efe62afd..979ed948 100644 --- a/HIAPI/Models/User.swift +++ b/HIAPI/Models/User.swift @@ -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 @@ -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 @@ -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") } } }