Bind permissions to roles and scope operator access by branch.
Replace permission_user with permission_role, enforce RBAC on admin routes, and limit operators to their assigned branches. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
427d5b4e07
commit
1fd0abbcb2
57 files changed
+1281
-657
No files matched your search
@@ -30,16 +30,23 @@ type ProfileBranchDTO struct {
|
||||
Name LocalizedText `json:"name"`
|
||||
}
|
||||
|
||||
type ProfilePermissionDTO struct {
|
||||
Id int64 `json:"id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type UserProfileDTO struct {
|
||||
Id int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
FirstName string `json:"firstName"`
|
||||
LastName string `json:"lastName"`
|
||||
Phone string `json:"phone"`
|
||||
Avatar string `json:"avatar"`
|
||||
Role *ProfileRoleDTO `json:"role"`
|
||||
Branches []ProfileBranchDTO `json:"branches"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Id int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
FirstName string `json:"firstName"`
|
||||
LastName string `json:"lastName"`
|
||||
Phone string `json:"phone"`
|
||||
Avatar string `json:"avatar"`
|
||||
Role *ProfileRoleDTO `json:"role"`
|
||||
Branches []ProfileBranchDTO `json:"branches"`
|
||||
Permissions []ProfilePermissionDTO `json:"permissions"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type UpdateProfileDTO struct {
|
||||
|
||||
Reference in new issue
Block a user