working commit

This commit is contained in:
2026-02-20 15:33:15 +02:00
parent 09f2125a4e
commit f973293315
18 changed files with 169 additions and 147 deletions
+6 -6
View File
@@ -14,7 +14,7 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/terms"
"mstore/pkg/term"
"mstore/pkg/uuid"
)
@@ -30,7 +30,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -63,7 +63,7 @@ func (hand *Handler) GetAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -96,7 +96,7 @@ func (hand *Handler) ListAccounts(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -129,7 +129,7 @@ func (hand *Handler) UpdateAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -162,7 +162,7 @@ func (hand *Handler) DeleteAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, params.Username)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, params.Username)
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)