working commit
This commit is contained in:
@@ -3,6 +3,7 @@ package operator
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"regexp"
|
||||
|
||||
"mstore/app/descr"
|
||||
"mstore/pkg/auxtool"
|
||||
@@ -36,6 +37,12 @@ func (oper *Operator) CreateGrant(ctx context.Context, operID string, params *Cr
|
||||
return res, err
|
||||
}
|
||||
|
||||
_, err = regexp.Compile(params.Pattern)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Cannot compile regexp %s: %v", err)
|
||||
return res, err
|
||||
}
|
||||
|
||||
grantExists, _, err := oper.mdb.GetGrantByAccoundIDRightPattern(ctx, params.AccountID, params.Right, params.Pattern)
|
||||
if err != nil {
|
||||
return res, err
|
||||
|
||||
Reference in New Issue
Block a user