mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: fetch workspaces by username with organization permissions (#17707)
Closes https://github.com/coder/coder/issues/17691 `ExtractOrganizationMembersParam` will allow fetching a user with only organization permissions. If the user belongs to 0 orgs, then the user "does not exist" from an org perspective. But if you are a site-wide admin, then the user does exist.
This commit is contained in:
@@ -289,11 +289,17 @@ func TestCreateUserWorkspace(t *testing.T) {
|
||||
|
||||
ctx = testutil.Context(t, testutil.WaitLong*1000) // Reset the context to avoid timeouts.
|
||||
|
||||
_, err = creator.CreateUserWorkspace(ctx, adminID.ID.String(), codersdk.CreateWorkspaceRequest{
|
||||
wrk, err := creator.CreateUserWorkspace(ctx, adminID.ID.String(), codersdk.CreateWorkspaceRequest{
|
||||
TemplateID: template.ID,
|
||||
Name: "workspace",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
coderdtest.AwaitWorkspaceBuildJobCompleted(t, admin, wrk.LatestBuild.ID)
|
||||
|
||||
_, err = creator.WorkspaceByOwnerAndName(ctx, adminID.Username, wrk.Name, codersdk.WorkspaceOptions{
|
||||
IncludeDeleted: false,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
// Asserting some authz calls when creating a workspace.
|
||||
|
||||
Reference in New Issue
Block a user