right type used

This commit is contained in:
2026-02-20 15:28:26 +02:00
parent 8546ad496f
commit 1c8f6f142c
18 changed files with 146 additions and 144 deletions
+10 -10
View File
@@ -14,8 +14,8 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
// POST /v3/account/create 200 200
@@ -30,7 +30,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -42,7 +42,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.CreateAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.CreateAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.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, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -75,7 +75,7 @@ func (hand *Handler) GetAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.GetAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.GetAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.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, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.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, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -141,7 +141,7 @@ func (hand *Handler) UpdateAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.UpdateAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.UpdateAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("UpdateAccount 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, auxuuid.UUID(operatorID), terms.RightWriteAccounts, params.Username)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, params.Username)
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -174,7 +174,7 @@ func (hand *Handler) DeleteAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.DeleteAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.DeleteAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("DeleteAccount error: %v", err)
hand.SendError(rctx, err)