From b49ae10a10ed57fb36a1e6f34c6532fe2fbccee9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 10 Dec 2024 18:23:23 -0800 Subject: [PATCH] fix roles --- pkg/service/security.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/service/security.go b/pkg/service/security.go index 236578b..1a4afe6 100644 --- a/pkg/service/security.go +++ b/pkg/service/security.go @@ -15,8 +15,10 @@ var ( ) var ( - RoleAdmin = 128 - RoleReviewer = 64 + // has SubmissionPublish + RoleMapAdmin int32 = 128 + // has SubmissionReview + RoleMapCouncil int32 = 64 ) type Roles struct { @@ -75,11 +77,11 @@ func (svc SecurityHandler) HandleCookieAuth(ctx context.Context, operationName a roles := Roles{} // fix this when roblox udpates group roles - for r := range role.Roles{ - if RoleAdmin<=r{ + for _,r := range role.Roles{ + if RoleMapAdmin<=r.Rank{ roles.SubmissionPublish = true } - if RoleReviewer<=r{ + if RoleMapCouncil<=r.Rank{ roles.SubmissionReview = true } }