feat: new users role

This commit is contained in:
Efril
2026-06-19 13:31:33 +07:00
parent 486d94335b
commit e345aeee97
12 changed files with 758 additions and 20 deletions
+6 -4
View File
@@ -63,10 +63,12 @@ type UserResponse struct {
func (u *User) HasPermission(requiredRole constants.UserRole) bool {
roleHierarchy := map[constants.UserRole]int{
constants.RoleWaiter: 1,
constants.RoleCashier: 2,
constants.RoleManager: 3,
constants.RoleAdmin: 4,
constants.RoleWaiter: 1,
constants.RoleCashier: 2,
constants.RolePurchasing: 3,
constants.RoleManager: 4,
constants.RoleAdmin: 5,
constants.RoleOwner: 6,
}
userLevel := roleHierarchy[u.Role]