fix roles
This commit is contained in:
parent
24e88c5a0a
commit
b49ae10a10
@ -15,8 +15,10 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
RoleAdmin = 128
|
// has SubmissionPublish
|
||||||
RoleReviewer = 64
|
RoleMapAdmin int32 = 128
|
||||||
|
// has SubmissionReview
|
||||||
|
RoleMapCouncil int32 = 64
|
||||||
)
|
)
|
||||||
|
|
||||||
type Roles struct {
|
type Roles struct {
|
||||||
@ -75,11 +77,11 @@ func (svc SecurityHandler) HandleCookieAuth(ctx context.Context, operationName a
|
|||||||
roles := Roles{}
|
roles := Roles{}
|
||||||
|
|
||||||
// fix this when roblox udpates group roles
|
// fix this when roblox udpates group roles
|
||||||
for r := range role.Roles{
|
for _,r := range role.Roles{
|
||||||
if RoleAdmin<=r{
|
if RoleMapAdmin<=r.Rank{
|
||||||
roles.SubmissionPublish = true
|
roles.SubmissionPublish = true
|
||||||
}
|
}
|
||||||
if RoleReviewer<=r{
|
if RoleMapCouncil<=r.Rank{
|
||||||
roles.SubmissionReview = true
|
roles.SubmissionReview = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user