add perms; editor, viewer
This commit is contained in:
parent
b647517ca6
commit
1ac38f26cb
8 changed files with 74 additions and 21 deletions
|
|
@ -6,10 +6,12 @@ const (
|
|||
ThaiPermission Permission = 1 << iota
|
||||
MalayPermission
|
||||
AusPermission
|
||||
Alpha3Permission
|
||||
// NOTE: Add more permission here
|
||||
|
||||
Viewer = 1 << 4
|
||||
Editor = Viewer << 3
|
||||
// SuperAdmin have max uint
|
||||
SuperAdmin = ThaiPermission | MalayPermission | AusPermission
|
||||
SuperAdmin = ThaiPermission | MalayPermission | AusPermission | Alpha3Permission | (Editor | Viewer)
|
||||
)
|
||||
|
||||
func (userPermissions Permission) IsHavePermission(requiredPermissions Permission) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue