generated from VLADIMIR/template
update roles
This commit is contained in:
@@ -13,3 +13,15 @@ var AllRoles = []string{
|
||||
Organizer,
|
||||
User,
|
||||
}
|
||||
|
||||
type IHasRole interface {
|
||||
HasRole(role string) bool
|
||||
}
|
||||
|
||||
func HasRole(claims IHasRole, role string) bool {
|
||||
if claims.HasRole(Admin) {
|
||||
return true
|
||||
}
|
||||
|
||||
return claims.HasRole(role)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user