diff --git a/HackIllinois: QR/Info.plist b/HackIllinois: QR/Info.plist
index e6aa547..d4ef68d 100644
--- a/HackIllinois: QR/Info.plist
+++ b/HackIllinois: QR/Info.plist
@@ -17,7 +17,7 @@
CFBundleShortVersionString
1.0
CFBundleVersion
- 1
+ 3
LSRequiresIPhoneOS
NSCameraUsageDescription
diff --git a/HackIllinois: QR/ViewController.swift b/HackIllinois: QR/ViewController.swift
index a1949e7..6ae8359 100644
--- a/HackIllinois: QR/ViewController.swift
+++ b/HackIllinois: QR/ViewController.swift
@@ -20,17 +20,12 @@ class BaseViewController: UIViewController {
func check_permissions(key: String) -> String {
let jwt: JWT = try! decode(jwt: key)
let json = JSON(jwt.body)
- let role = json["roles"][0]["role"].rawString()
- if (role == "STAFF" || role == "VOLUNTEER") {
- return "SCAN"
- }
- else if (role == "ADMIN")
- {
- return "ADMIN"
- }
- else {
- return "NONE"
+ let roles = json["roles"].arrayValue.map { (role) -> String in
+ return role.dictionaryValue["role"]!.stringValue
}
+ if roles.contains("ADMIN") { return "ADMIN" }
+ else if roles.contains("STAFF") || roles.contains("VOLUNTEER") { return "SCAN" }
+ else { return "NONE" }
}
func get_email(key: String) -> String {