right type used

This commit is contained in:
2026-02-20 15:28:26 +02:00
parent 8546ad496f
commit 1c8f6f142c
18 changed files with 146 additions and 144 deletions
+15 -15
View File
@@ -15,8 +15,8 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
const zeroContentLength = "0"
@@ -29,7 +29,7 @@ func (hand *Handler) FileInfo(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -40,7 +40,7 @@ func (hand *Handler) FileInfo(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, res, err := hand.oper.FileInfo(ctx, auxuuid.UUID(operatorID), params)
code, res, err := hand.oper.FileInfo(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("FileInfo error: %v", err)
rctx.SetStatus(code)
@@ -74,7 +74,7 @@ func (hand *Handler) PutFile(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -85,7 +85,7 @@ func (hand *Handler) PutFile(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, _, err := hand.oper.PutFile(ctx, auxuuid.UUID(operatorID), params)
code, _, err := hand.oper.PutFile(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("PutFile error: %v", err)
rctx.SetStatus(code)
@@ -102,7 +102,7 @@ func (hand *Handler) GetFile(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -113,7 +113,7 @@ func (hand *Handler) GetFile(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, res, err := hand.oper.GetFile(ctx, auxuuid.UUID(operatorID), params)
code, res, err := hand.oper.GetFile(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("PutFile error: %v", err)
rctx.SetStatus(code)
@@ -150,7 +150,7 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -161,7 +161,7 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, _, err := hand.oper.DeleteFile(ctx, auxuuid.UUID(operatorID), params)
code, _, err := hand.oper.DeleteFile(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("DeleteFIle error: %v", err)
}
@@ -187,7 +187,7 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -198,7 +198,7 @@ func (hand *Handler) ListFiles(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, res, err := hand.oper.ListFiles(ctx, auxuuid.UUID(operatorID), params)
code, res, err := hand.oper.ListFiles(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("ListFiles error: %v", err)
rctx.SetStatus(code)
@@ -224,7 +224,7 @@ func (hand *Handler) ListCollections(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -235,7 +235,7 @@ func (hand *Handler) ListCollections(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, res, err := hand.oper.ListCollections(ctx, auxuuid.UUID(operatorID), params)
code, res, err := hand.oper.ListCollections(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("ListCollections error: %v", err)
rctx.SetStatus(code)
@@ -262,7 +262,7 @@ func (hand *Handler) DeleteCollection(rctx *router.Context) {
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadFiles, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadFiles, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -273,7 +273,7 @@ func (hand *Handler) DeleteCollection(rctx *router.Context) {
}
// Execution of the operation
ctx := rctx.GetContext()
code, res, err := hand.oper.DeleteColletion(ctx, auxuuid.UUID(operatorID), params)
code, res, err := hand.oper.DeleteColletion(ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("DeleteColletion error: %v", err)
rctx.SetStatus(code)