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
+6 -6
View File
@@ -17,8 +17,8 @@ import (
"mstore/app/router"
"mstore/pkg/auxhttp"
"mstore/pkg/auxpwd"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
const (
@@ -44,12 +44,12 @@ func (hand *Handler) AuthMiddleware(next router.Handler) router.Handler {
}
// Authentification
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, auxuuid.UUID, error) {
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, uuid.UUID, error) {
var err error
var success bool
var username string
var password string
var accountID auxuuid.UUID
var accountID uuid.UUID
accountID = terms.AnonymousID
@@ -80,9 +80,9 @@ anonymous:
return success, accountID, err
}
func (hand *Handler) ValidatePassword(ctx context.Context, username, password string) (bool, auxuuid.UUID, error) {
func (hand *Handler) ValidatePassword(ctx context.Context, username, password string) (bool, uuid.UUID, error) {
var err error
var accountID auxuuid.UUID
var accountID uuid.UUID
valid := false
accountExists, accountDescr, err := hand.mdb.GetAccountByUsername(ctx, username)
@@ -102,7 +102,7 @@ func (hand *Handler) ValidatePassword(ctx context.Context, username, password st
// Authorization
func (hand *Handler) CheckRight(ctx context.Context, accountID auxuuid.UUID, reqRight, subject string) (bool, error) {
func (hand *Handler) CheckRight(ctx context.Context, accountID uuid.UUID, reqRight terms.Right, subject string) (bool, error) {
var err error
var res bool
//hand.logg.Debugf("Cop check your right %s: %s %s", accountID, reqRight, subject)
+10 -10
View File
@@ -14,8 +14,8 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
// POST /v3/account/create 200 200
@@ -30,7 +30,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -42,7 +42,7 @@ func (hand *Handler) CreateAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.CreateAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.CreateAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -63,7 +63,7 @@ func (hand *Handler) GetAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -75,7 +75,7 @@ func (hand *Handler) GetAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.GetAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.GetAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -96,7 +96,7 @@ func (hand *Handler) ListAccounts(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -129,7 +129,7 @@ func (hand *Handler) UpdateAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -141,7 +141,7 @@ func (hand *Handler) UpdateAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.UpdateAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.UpdateAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("UpdateAccount error: %v", err)
hand.SendError(rctx, err)
@@ -162,7 +162,7 @@ func (hand *Handler) DeleteAccount(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, params.Username)
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, params.Username)
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -174,7 +174,7 @@ func (hand *Handler) DeleteAccount(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.DeleteAccount(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.DeleteAccount(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("DeleteAccount error: %v", err)
hand.SendError(rctx, err)
+7 -7
View File
@@ -16,8 +16,8 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
// HEAD /v2/<name>/blobs/<digest> 200 404
@@ -33,7 +33,7 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -73,7 +73,7 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -118,7 +118,7 @@ func (hand *Handler) PatchUpload(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -162,7 +162,7 @@ func (hand *Handler) PutUpload(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -192,7 +192,7 @@ func (hand *Handler) GetBlob(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -238,7 +238,7 @@ func (hand *Handler) DeleteBlob(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
+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)
+11 -11
View File
@@ -14,8 +14,8 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
// POST /v3/grant/create 200 200
@@ -30,7 +30,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -42,7 +42,7 @@ func (hand *Handler) CreateGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.CreateGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.CreateGrant(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("CreateGrant error: %v", err)
hand.SendError(rctx, err)
@@ -63,7 +63,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -75,7 +75,7 @@ func (hand *Handler) GetGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.GetGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.GetGrant(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("CreateGrant error: %v", err)
hand.SendError(rctx, err)
@@ -96,7 +96,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -108,7 +108,7 @@ func (hand *Handler) ListGrants(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.ListGrants(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.ListGrants(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("ListGrants error: %v", err)
hand.SendError(rctx, err)
@@ -129,7 +129,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -141,7 +141,7 @@ func (hand *Handler) UpdateGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.UpdateGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.UpdateGrant(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("UpdateGrant error: %v", err)
hand.SendError(rctx, err)
@@ -162,7 +162,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteAccounts, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteAccounts, "")
if err != nil {
err := fmt.Errorf("Operation error: %v", err)
hand.SendError(rctx, err)
@@ -174,7 +174,7 @@ func (hand *Handler) DeleteGrant(rctx *router.Context) {
return
}
// Execution of the operation
res, err := hand.oper.DeleteGrant(rctx.Ctx, auxuuid.UUID(operatorID), params)
res, err := hand.oper.DeleteGrant(rctx.Ctx, uuid.UUID(operatorID), params)
if err != nil {
hand.logg.Errorf("DeleteGrant error: %v", err)
hand.SendError(rctx, err)
+7 -7
View File
@@ -14,8 +14,8 @@ import (
"mstore/app/operator"
"mstore/app/router"
"mstore/pkg/auxuuid"
"mstore/pkg/terms"
"mstore/pkg/uuid"
)
func (hand *Handler) ManifestExists(rctx *router.Context) {
@@ -30,7 +30,7 @@ func (hand *Handler) ManifestExists(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -72,7 +72,7 @@ func (hand *Handler) PutManifest(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -105,7 +105,7 @@ func (hand *Handler) GetManifest(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -145,7 +145,7 @@ func (hand *Handler) DeleteManifest(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightWriteImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightWriteImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -174,7 +174,7 @@ func (hand *Handler) GetReferer(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return
@@ -200,7 +200,7 @@ func (hand *Handler) GetTags(rctx *router.Context) {
}
// Rigth checking
operatorID, _ := rctx.GetString(userTag)
opEnable, err := hand.CheckRight(rctx.Ctx, auxuuid.UUID(operatorID), terms.RightReadImages, "")
opEnable, err := hand.CheckRight(rctx.Ctx, uuid.UUID(operatorID), terms.RightReadImages, "")
if err != nil {
rctx.SetStatus(http.StatusInternalServerError)
return