MCPcopy Index your code
hub / github.com/authorizerdev/authorizer / IsValidRoles

Function IsValidRoles

internal/validators/roles.go:6–16  ·  view source on GitHub ↗

IsValidRoles validates roles

(userRoles []string, roles []string)

Source from the content-addressed store, hash-verified

4
5// IsValidRoles validates roles
6func IsValidRoles(userRoles []string, roles []string) bool {
7 valid := true
8 for _, userRole := range userRoles {
9 if !utils.StringSliceContains(roles, userRole) {
10 valid = false
11 break
12 }
13 }
14
15 return valid
16}

Callers 7

UpdateUserMethod · 0.92
MagicLinkLoginMethod · 0.92
LoginMethod · 0.92
SignUpMethod · 0.92
VerifyEmailHandlerMethod · 0.92
OAuthLoginHandlerMethod · 0.92
TestIsValidRolesFunction · 0.85

Calls 1

StringSliceContainsFunction · 0.92

Tested by 1

TestIsValidRolesFunction · 0.68