chore: add workspace id filter on api (#12483)

* chore: add workspace id filter on api
This commit is contained in:
Steven Masley
2024-03-11 11:37:15 -05:00
committed by GitHub
parent 8f40ee3465
commit e3051dff0c
7 changed files with 84 additions and 17 deletions

View File

@ -8266,6 +8266,19 @@ func (q *FakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.
}
}
if len(arg.WorkspaceIds) > 0 {
match := false
for _, id := range arg.WorkspaceIds {
if workspace.ID == id {
match = true
break
}
}
if !match {
continue
}
}
// If the filter exists, ensure the object is authorized.
if prepared != nil && prepared.Authorize(ctx, workspace.RBACObject()) != nil {
continue