working commit

This commit is contained in:
2026-02-19 11:55:17 +02:00
parent 1fd55521de
commit bb0f58f46c
37 changed files with 231 additions and 150 deletions
+4 -4
View File
@@ -14,10 +14,10 @@ import (
"fmt"
"regexp"
"mstore/app/descr"
"mstore/app/router"
"mstore/pkg/auxhttp"
"mstore/pkg/auxpwd"
"mstore/pkg/terms"
)
const (
@@ -53,7 +53,7 @@ func (hand *Handler) CheckAccess(rctx *router.Context) (bool, string, error) {
var password string
var accountID string
accountID = descr.AnonymousID
accountID = terms.AnonymousID
authHeader := rctx.GetHeader("Authorization")
if authHeader != "" {
@@ -80,7 +80,7 @@ func (hand *Handler) CheckAccess(rctx *router.Context) (bool, string, error) {
}
anonymous:
success = true
accountID = descr.AnonymousID
accountID = terms.AnonymousID
return success, accountID, err
}
@@ -125,7 +125,7 @@ func (hand *Handler) CheckRight(ctx context.Context, accountID, reqRight, subjec
return res, err
}
switch reqRight {
case descr.RightReadFiles, descr.RightWriteFiles:
case terms.RightReadFiles, terms.RightWriteFiles:
for _, grant := range grants {
re, err := regexp.Compile(grant.Pattern)
if err != nil {