working commit
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user