File tree 1 file changed +5
-9
lines changed 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,13 @@ func (q *AuthzQuerier) GetLatestWorkspaceBuildsByWorkspaceIDs(ctx context.Contex
40
40
// This is not ideal as not all builds will be returned if the workspace cannot be read.
41
41
// This should probably be handled differently? Maybe join workspace builds with workspace
42
42
// ownership properties and filter on that.
43
- workspaces , err := q .GetWorkspaces (ctx , database.GetWorkspacesParams {WorkspaceIds : ids })
44
- if err != nil {
45
- return nil , err
46
- }
47
-
48
- allowedIDs := make ([]uuid.UUID , 0 , len (workspaces ))
49
- for _ , workspace := range workspaces {
50
- allowedIDs = append (allowedIDs , workspace .ID )
43
+ for _ , id := range ids {
44
+ if err := q .authorizeContext (ctx , rbac .ActionRead , rbac .ResourceWorkspace .WithID (id )); err != nil {
45
+ return nil , err
46
+ }
51
47
}
52
48
53
- return q .database .GetLatestWorkspaceBuildsByWorkspaceIDs (ctx , allowedIDs )
49
+ return q .database .GetLatestWorkspaceBuildsByWorkspaceIDs (ctx , ids )
54
50
}
55
51
56
52
func (q * AuthzQuerier ) GetWorkspaceAgentByID (ctx context.Context , id uuid.UUID ) (database.WorkspaceAgent , error ) {
You can’t perform that action at this time.
0 commit comments