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:
2026-08-24 18:24:43 +05:00
parent 427d5b4e07
commit 1fd0abbcb2
57 changed files with 1281 additions and 657 deletions

View File

@@ -7,6 +7,7 @@ var (
ErrUnauthorized = NewAppError(nil, "Invalid credentials or unauthorized access.", "SE-00002")
ErrNotFound = NewAppError(nil, "The requested resource was not found.", "SE-00003")
ErrInternalServer = NewAppError(nil, "An internal server error occurred. Please try again later.", "SE-00004")
ErrForbidden = NewAppError(nil, "Sana rugsat yok.", "SE-00011")
ErrNotAcceptable = NewAppError(nil, "The request could not be processed.", "SE-00007")
ErrConflict = NewAppError(nil, "A user with this phone or username already exists.", "SE-00008")
ErrInvalidCode = NewAppError(nil, "Invalid or expired verification code.", "SE-00009")