Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PRO role to fix attendee login #568

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading