working commit

This commit is contained in:
2026-02-21 13:16:30 +02:00
parent cd37a4508c
commit d650d58a6d
1149 changed files with 116 additions and 722633 deletions
+8 -8
View File
@@ -15,7 +15,7 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/term"
"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, term.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, params.Filepath)
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, term.RightWriteFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteFiles, params.Filepath)
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, term.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, params.Filepath)
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, term.RightWriteFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightWriteFiles, params.Filepath)
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -186,7 +186,7 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, params.Filepath)
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -223,7 +223,7 @@ func (hand *Handler) ListCollections(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, params.Path)
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -261,7 +261,7 @@ func (hand *Handler) DeleteCollection(rctx *router.Context) {
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, term.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, operatorID, terms.RightReadFiles, params.Path)
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return