feat: add "updated" search param to workspaces (#11714)

* feat: add "updated" search param to workspaces
* rego -> sql needs to specify which <table>.organization_id
This commit is contained in:
Steven Masley
2024-01-23 11:52:06 -06:00
committed by GitHub
parent 081fbef097
commit d6ba0dfecb
10 changed files with 159 additions and 25 deletions

View File

@ -198,7 +198,7 @@ type workspaceQuerier interface {
// This code is copied from `GetWorkspaces` and adds the authorized filter WHERE
// clause.
func (q *sqlQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg GetWorkspacesParams, prepared rbac.PreparedAuthorized) ([]GetWorkspacesRow, error) {
authorizedFilter, err := prepared.CompileToSQL(ctx, rbac.ConfigWithoutACL())
authorizedFilter, err := prepared.CompileToSQL(ctx, rbac.ConfigWorkspaces())
if err != nil {
return nil, xerrors.Errorf("compile authorized filter: %w", err)
}
@ -225,6 +225,7 @@ func (q *sqlQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg GetWorkspa
arg.Dormant,
arg.LastUsedBefore,
arg.LastUsedAfter,
arg.UsingActive,
arg.Offset,
arg.Limit,
)