working commit
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
"mstore/pkg/term"
|
||||
"mstore/pkg/terms"
|
||||
)
|
||||
|
||||
// POST /v3/grant/create 200 200
|
||||
@@ -29,7 +29,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -62,7 +62,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightReadAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -95,7 +95,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightReadAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -128,7 +128,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -161,7 +161,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
|
||||
Reference in New Issue
Block a user