right type used
This commit is contained in:
+7
-7
@@ -16,8 +16,8 @@ import (
|
||||
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
"mstore/pkg/auxuuid"
|
||||
"mstore/pkg/terms"
|
||||
"mstore/pkg/uuid"
|
||||
)
|
||||
|
||||
// HEAD /v2/<name>/blobs/<digest> 200 404
|
||||
@@ -33,7 +33,7 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -73,7 +73,7 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -118,7 +118,7 @@ func (hand *Handler) PatchUpload(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -162,7 +162,7 @@ func (hand *Handler) PutUpload(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -192,7 +192,7 @@ func (hand *Handler) GetBlob(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -238,7 +238,7 @@ func (hand *Handler) DeleteBlob(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user