working commit

This commit is contained in:
2026-02-20 15:33:15 +02:00
parent 09f2125a4e
commit f973293315
18 changed files with 169 additions and 147 deletions
+5 -5
View File
@@ -17,7 +17,7 @@ import (
"mstore/app/router"
"mstore/pkg/auxhttp"
"mstore/pkg/auxpwd"
"mstore/pkg/terms"
"mstore/pkg/term"
"mstore/pkg/uuid"
)
@@ -51,7 +51,7 @@ func (hand *Handler) CheckAccess(rctx *router.Context) (bool, uuid.UUID, error)
var password string
var accountID uuid.UUID
accountID = terms.AnonymousID
accountID = term.AnonymousID
authHeader := rctx.GetHeader("Authorization")
if authHeader != "" {
@@ -76,7 +76,7 @@ func (hand *Handler) CheckAccess(rctx *router.Context) (bool, uuid.UUID, error)
}
anonymous:
success = true
accountID = terms.AnonymousID
accountID = term.AnonymousID
return success, accountID, err
}
@@ -102,7 +102,7 @@ func (hand *Handler) ValidatePassword(ctx context.Context, username, password st
// Authorization
func (hand *Handler) CheckRight(ctx context.Context, accountID uuid.UUID, reqRight terms.Right, subject string) (bool, error) {
func (hand *Handler) CheckRight(ctx context.Context, accountID uuid.UUID, reqRight term.Right, subject string) (bool, error) {
var err error
var res bool
//hand.logg.Debugf("Cop check your right %s: %s %s", accountID, reqRight, subject)
@@ -121,7 +121,7 @@ func (hand *Handler) CheckRight(ctx context.Context, accountID uuid.UUID, reqRig
return res, err
}
switch reqRight {
case terms.RightReadFiles, terms.RightWriteFiles:
case term.RightReadFiles, term.RightWriteFiles:
for _, grant := range grants {
re, err := regexp.Compile(grant.Pattern)
if err != nil {