fix: import cycle issues
This commit is contained in:
16
server/validators/roles.go
Normal file
16
server/validators/roles.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package validators
|
||||
|
||||
import "github.com/authorizerdev/authorizer/server/utils"
|
||||
|
||||
// IsValidRoles validates roles
|
||||
func IsValidRoles(userRoles []string, roles []string) bool {
|
||||
valid := true
|
||||
for _, userRole := range userRoles {
|
||||
if !utils.StringSliceContains(roles, userRole) {
|
||||
valid = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return valid
|
||||
}
|
Reference in New Issue
Block a user