working commit

This commit is contained in:
2026-02-19 11:55:17 +02:00
parent 1fd55521de
commit bb0f58f46c
37 changed files with 231 additions and 150 deletions
+8 -8
View File
@@ -13,9 +13,9 @@ import (
"io"
"net/http"
"mstore/app/descr"
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/terms"
)
const zeroContentLength = "0"
@@ -28,7 +28,7 @@ func (hand *Handler) FileInfo(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -73,7 +73,7 @@ func (hand *Handler) PutFile(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightWriteFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -101,7 +101,7 @@ func (hand *Handler) GetFile(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -149,7 +149,7 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightWriteFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -179,7 +179,7 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -210,7 +210,7 @@ func (hand *Handler) ListCollections(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -248,7 +248,7 @@ func (hand *Handler) DeleteCollection(rctx *router.Context) {
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, descr.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return