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

No files matched your search

+2
View File
@@ -8,6 +8,7 @@ import (
"online-back/internal/identity"
"online-back/internal/identity/activitylog"
activitylogdb "online-back/internal/identity/activitylog/db"
"online-back/internal/identity/rbac"
"online-back/internal/lending"
"online-back/internal/org"
"online-back/pkg/logging"
@@ -52,6 +53,7 @@ func New(cfg *config.Config, client *pgxpool.Pool, logger *logging.Logger) *gin.
adminGroup := router.Group(adminAPIPrefix)
adminGroup.Use(activitylog.Record(activitylogdb.NewRepository(client, logger), logger))
adminGroup.Use(rbac.Guard(rbac.NewService(client)))
// Each bounded context registers its own modules' handlers.
// Add new modules inside the relevant context's router.go rather than here.