working commit
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user