This commit is contained in:
Олег Бородин
2024-09-14 07:49:45 +02:00
parent f25197e714
commit 7a267cdc4d
22 changed files with 1026 additions and 342 deletions

View File

@@ -30,6 +30,17 @@ func (db *Database) ListGrantsByAccountID(ctx context.Context, accountID int64)
return res, err
}
func (db *Database) ListGrants(ctx context.Context) ([]descriptor.Grant, error) {
var err error
request := `SELECT * FROM grant`
res := make([]descriptor.Grant, 0)
err = db.db.Select(&res, request)
if err != nil {
return res, err
}
return res, err
}
func (db *Database) GetGrant(ctx context.Context, accountID int64, operation string) (bool, *descriptor.Grant, error) {
var err error
res := &descriptor.Grant{}