uuid used
This commit is contained in:
+11
-10
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
"mstore/pkg/auxuuid"
|
||||
"mstore/pkg/terms"
|
||||
)
|
||||
|
||||
@@ -29,7 +30,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -41,7 +42,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.CreateGrant(rctx.Ctx, operatorID, params)
|
||||
res, err := hand.oper.CreateGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("CreateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -62,7 +63,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -74,7 +75,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.GetGrant(rctx.Ctx, operatorID, params)
|
||||
res, err := hand.oper.GetGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("CreateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -95,7 +96,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -107,7 +108,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.ListGrants(rctx.Ctx, operatorID, params)
|
||||
res, err := hand.oper.ListGrants(rctx.Ctx, auxuuid.UUID(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("ListGrants error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -128,7 +129,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -140,7 +141,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.UpdateGrant(rctx.Ctx, operatorID, params)
|
||||
res, err := hand.oper.UpdateGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("UpdateGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -161,7 +162,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteAccounts, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Operation error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
@@ -173,7 +174,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
|
||||
return
|
||||
}
|
||||
// Execution of the operation
|
||||
res, err := hand.oper.DeleteGrant(rctx.Ctx, operatorID, params)
|
||||
res, err := hand.oper.DeleteGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("DeleteGrant error: %v", err)
|
||||
hand.SendError(rctx, err)
|
||||
|
||||
Reference in New Issue
Block a user