prepareSQLFilter is a helper function that prepares a SQL filter using the given authorization context.
(ctx context.Context, authorizer rbac.Authorizer, action policy.Action, resourceType string)
| 1138 | // prepareSQLFilter is a helper function that prepares a SQL filter using the |
| 1139 | // given authorization context. |
| 1140 | func prepareSQLFilter(ctx context.Context, authorizer rbac.Authorizer, action policy.Action, resourceType string) (rbac.PreparedAuthorized, error) { |
| 1141 | act, ok := ActorFromContext(ctx) |
| 1142 | if !ok { |
| 1143 | return nil, ErrNoActor |
| 1144 | } |
| 1145 | |
| 1146 | return authorizer.Prepare(ctx, act, action, resourceType) |
| 1147 | } |
| 1148 | |
| 1149 | func (q *querier) Ping(ctx context.Context) (time.Duration, error) { |
| 1150 | return q.db.Ping(ctx) |
no test coverage detected