working commit
This commit is contained in:
+11
-11
@@ -15,7 +15,7 @@ import (
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
"mstore/pkg/term"
|
||||
"mstore/pkg/uuid"
|
||||
"mstore/pkg/auxid"
|
||||
)
|
||||
|
||||
// POST /v3/grant/create 200 200
|
||||
@@ -30,7 +30,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -42,7 +42,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.CreateGrant(rctx.Ctx, uuid.UUID(operatorID), params)
|
||||
res, err := hand.oper.CreateGrant(rctx.Ctx, uint64(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("CreateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -63,7 +63,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightReadAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.RightReadAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -75,7 +75,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.GetGrant(rctx.Ctx, uuid.UUID(operatorID), params)
|
||||
res, err := hand.oper.GetGrant(rctx.Ctx, uint64(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("CreateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -96,7 +96,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightReadAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.RightReadAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -108,7 +108,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.ListGrants(rctx.Ctx, uuid.UUID(operatorID), params)
|
||||
res, err := hand.oper.ListGrants(rctx.Ctx, uint64(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("ListGrants error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -129,7 +129,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -141,7 +141,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.UpdateGrant(rctx.Ctx, uuid.UUID(operatorID), params)
|
||||
res, err := hand.oper.UpdateGrant(rctx.Ctx, uint64(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("UpdateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -162,7 +162,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), term.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -174,7 +174,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.DeleteGrant(rctx.Ctx, uuid.UUID(operatorID), params)
|
||||
res, err := hand.oper.DeleteGrant(rctx.Ctx, uint64(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("DeleteGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
|
||||
Reference in New Issue
Block a user