Add backups, currencies and dashboard APIs, and scope access by guard_name.
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled

Web users may only CRUD their own records, operators stay in assigned branches, and admin/manager/superadmin keep full access.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
guwandykandCursor committed 2026-08-31 18:14:47 +05:00
1 parent 0d000f9af6
commit 28509eb4ca
65 files changed
+9132 -296

No files matched your search

+3 -3
View File
@@ -97,7 +97,7 @@ func (h *handler) getByID(c *gin.Context) {
c.JSON(http.StatusInternalServerError, appresult.ErrInternalServer)
return
}
if !rbac.GuardBranch(c, item.BranchId) {
if !rbac.GuardOrder(c, item.UserId, item.BranchId) {
return
}
@@ -249,7 +249,7 @@ func parseListFilter(c *gin.Context) (ListFilter, bool) {
}
func (h *handler) guardBranchByID(c *gin.Context, id int64) bool {
if !rbac.HasBranchScope(c) {
if rbac.SkipRecordGuard(c) {
return true
}
item, err := h.repository.GetByID(c.Request.Context(), id)
@@ -261,5 +261,5 @@ func (h *handler) guardBranchByID(c *gin.Context, id int64) bool {
c.JSON(http.StatusInternalServerError, appresult.ErrInternalServer)
return false
}
return rbac.GuardBranch(c, item.BranchId)
return rbac.GuardOrder(c, item.UserId, item.BranchId)
}