working commit
This commit is contained in:
@@ -93,6 +93,20 @@ func (db *Database) GetGrantByAccoundIDRight(ctx context.Context, accountID, rig
|
||||
return true, res, err
|
||||
}
|
||||
|
||||
func (db *Database) ListGrantsByAccoundIDRight(ctx context.Context, accountID, right string) (bool, []descr.Grant, error) {
|
||||
var err error
|
||||
request := `SELECT * FROM grants WHERE account_id = $1 AND right = $2`
|
||||
res := make([]descr.Grant, 0)
|
||||
err = db.db.Select(&res, request, accountID, right)
|
||||
if err != nil {
|
||||
return false, res, err
|
||||
}
|
||||
if len(res) == 0 {
|
||||
return false, res, err
|
||||
}
|
||||
return true, res, err
|
||||
}
|
||||
|
||||
func (db *Database) GetGrantByAccoundIDRightPattern(ctx context.Context, accountID, right, pattern string) (bool, *descr.Grant, error) {
|
||||
var err error
|
||||
res := &descr.Grant{}
|
||||
|
||||
Reference in New Issue
Block a user