working commit
This commit is contained in:
+15
-15
@@ -16,7 +16,7 @@ import (
|
||||
"mstore/app/operator"
|
||||
"mstore/app/router"
|
||||
"mstore/pkg/term"
|
||||
"mstore/pkg/uuid"
|
||||
"mstore/pkg/auxid"
|
||||
)
|
||||
|
||||
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, uuid.UUID(operatorID), term.RightReadFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, res, err := hand.oper.FileInfo(ctx, uint64(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, uuid.UUID(operatorID), term.RightWriteFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, _, err := hand.oper.PutFile(ctx, uint64(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, uuid.UUID(operatorID), term.RightReadFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, res, err := hand.oper.GetFile(ctx, uint64(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, uuid.UUID(operatorID), term.RightWriteFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, _, err := hand.oper.DeleteFile(ctx, uint64(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, uuid.UUID(operatorID), term.RightReadFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, res, err := hand.oper.ListFiles(ctx, uint64(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, uuid.UUID(operatorID), term.RightReadFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, res, err := hand.oper.ListCollections(ctx, uint64(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, uuid.UUID(operatorID), term.RightReadFiles, "")
|
||||
opEnable, err := hand.CheckRight(rctx.Ctx, uint64(operatorID), term.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, uuid.UUID(operatorID), params)
|
||||
code, res, err := hand.oper.DeleteColletion(ctx, uint64(operatorID), params)
|
||||
if err != nil {
|
||||
hand.logg.Errorf("DeleteColletion error: %v", err)
|
||||
rctx.SetStatus(code)
|
||||
|
||||
Reference in New Issue
Block a user