working commit
This commit is contained in:
@@ -106,7 +106,7 @@ func (hand *Handler) ValidatePassword(ctx context.Context, username, password st
|
||||
func (hand *Handler) CheckRight(ctx context.Context, accountID, reqRight, subject string) (bool, error) {
|
||||
var err error
|
||||
var res bool
|
||||
hand.logg.Debugf("Check right %s: right=%s subj=%s", accountID, reqRight, subject)
|
||||
hand.logg.Debugf("Check right %s: right=[%s] subj=[%s]", accountID, reqRight, subject)
|
||||
exists, grants, err := hand.mdb.ListGrantsByAccoundIDRight(ctx, accountID, reqRight)
|
||||
if err != nil {
|
||||
return res, err
|
||||
@@ -117,7 +117,7 @@ func (hand *Handler) CheckRight(ctx context.Context, accountID, reqRight, subjec
|
||||
switch reqRight {
|
||||
case terms.RightReadFiles, terms.RightWriteFiles, terms.RightReadImages, terms.RightWriteImages:
|
||||
for _, grant := range grants {
|
||||
hand.logg.Debugf("Grant pattern=[%s], subject=[%s]", grant.Pattern, subject)
|
||||
//hand.logg.Debugf("Grant accountID=[%s] pattern=[%s], subject=[%s]", accountID, grant.Pattern, subject)
|
||||
|
||||
re, err := regexp.Compile(grant.Pattern)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user