working commit

This commit is contained in:
2026-02-14 18:45:11 +02:00
parent 8d46c6a677
commit 53ed35dc08
16 changed files with 144 additions and 120 deletions
+12 -25
View File
@@ -10,7 +10,6 @@
package handler
import (
"fmt"
"net/http"
"mstore/app/descr"
@@ -30,13 +29,11 @@ func (hand *Handler) ManifestExists(rctx *router.Context) {
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
if !opEnable {
err := fmt.Errorf("Operation not enabled for this account")
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusMethodNotAllowed)
return
}
// Execution of the operation
@@ -74,13 +71,11 @@ func (hand *Handler) PutManifest(rctx *router.Context) {
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightWriteImages, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
if !opEnable {
err := fmt.Errorf("Operation not enabled for this account")
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusMethodNotAllowed)
return
}
// Execution of the operation
@@ -107,13 +102,11 @@ func (hand *Handler) GetManifest(rctx *router.Context) {
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
if !opEnable {
err := fmt.Errorf("Operation not enabled for this account")
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusMethodNotAllowed)
return
}
// Execution of the operation
@@ -147,13 +140,11 @@ func (hand *Handler) DeleteManifest(rctx *router.Context) {
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightWriteImages, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
if !opEnable {
err := fmt.Errorf("Operation not enabled for this account")
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusMethodNotAllowed)
return
}
// Execution of the operation
@@ -178,13 +169,11 @@ func (hand *Handler) GetReferer(rctx *router.Context) {
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
if !opEnable {
err := fmt.Errorf("Operation not enabled for this account")
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusMethodNotAllowed)
return
}
// Execution of the operation
@@ -206,13 +195,11 @@ func (hand *Handler) GetTags(rctx *router.Context) {
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadImages, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusInternalServerError)
return
}
if !opEnable {
err := fmt.Errorf("Operation not enabled for this account")
hand.SendError(rctx, err)
rctx.SetStatus(http.StatusMethodNotAllowed)
return
}
// Execution of the operation