mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-11-09 15:59:58 +01:00
1 parent
b5dd0cfacd
commit
8333ea88a8
148 files changed
+3077
-23976
No files matched your search
+3
-3
@@ -5,7 +5,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/SecurityBrewery/catalyst/generated/models"
|
||||
"github.com/SecurityBrewery/catalyst/generated/model"
|
||||
)
|
||||
|
||||
type Role string
|
||||
@@ -52,7 +52,7 @@ func (p Role) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func UserHasRoles(user *models.UserResponse, roles []Role) bool {
|
||||
func UserHasRoles(user *model.UserResponse, roles []Role) bool {
|
||||
hasRoles := true
|
||||
for _, role := range roles {
|
||||
if !UserHasRole(user, role) {
|
||||
@@ -63,7 +63,7 @@ func UserHasRoles(user *models.UserResponse, roles []Role) bool {
|
||||
return hasRoles
|
||||
}
|
||||
|
||||
func UserHasRole(user *models.UserResponse, role Role) bool {
|
||||
func UserHasRole(user *model.UserResponse, role Role) bool {
|
||||
return ContainsRole(FromStrings(user.Roles), role)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user