working commit
This commit is contained in:
@@ -12,9 +12,9 @@ package handler
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"mstore/app/descr"
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
"mstore/pkg/terms"
|
||||
)
|
||||
|
||||
func (hand *Handler) ManifestExists(rctx *router.Context) {
|
||||
@@ -29,7 +29,7 @@ func (hand *Handler) ManifestExists(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -71,7 +71,7 @@ func (hand *Handler) PutManifest(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightWriteImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -104,7 +104,7 @@ func (hand *Handler) GetManifest(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -144,7 +144,7 @@ func (hand *Handler) DeleteManifest(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightWriteImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -173,7 +173,7 @@ func (hand *Handler) GetReferer(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
@@ -199,7 +199,7 @@ func (hand *Handler) GetTags(rctx *router.Context) {
|
||||
}
|
||||
// Rigth checking
|
||||
operatorID, _ := rctx.GetString(userTag)
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadImages, "")
|
||||
if err != nil {
|
||||
rctx.SetStatus(http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user