Skip to content

chore: hide workspace creation UI for users without permission #16871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 3, 2025

Conversation

jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Mar 10, 2025

@jaaydenh jaaydenh force-pushed the jaaydenh/workspace-creation branch from 03acbe3 to 124bf93 Compare March 10, 2025 22:44
@github-actions github-actions bot added the stale This issue is like stale bread. label Mar 19, 2025
@github-actions github-actions bot closed this Mar 23, 2025
@jaaydenh jaaydenh reopened this Mar 26, 2025
@jaaydenh jaaydenh requested a review from aslilac March 26, 2025 11:38
@jaaydenh jaaydenh marked this pull request as ready for review March 26, 2025 11:38
@jaaydenh jaaydenh removed the stale This issue is like stale bread. label Mar 26, 2025
Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should move the check I mentioned into modules/permissions so that it's more visible. maybe modules/permissions/workspaces.ts?

I definitely think we should keep this it's own thing, rather than tying to the organizationPermissions query. other than that it all looks good!

Comment on lines 118 to 125
createWorkspaces: {
object: {
resource_type: "workspace",
organization_id: organizationId,
owner_id: "*",
},
action: "create",
},
Copy link
Member

@aslilac aslilac Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't really related to the rest of the permissions in this query.

we have a query in pages/CreateWorkspacePage/permissions.ts that could be used for this already (it's the exact same permission check, just by itself)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to modules/permissions/workspaces.ts

@jaaydenh jaaydenh requested a review from aslilac April 1, 2025 22:39
@jaaydenh jaaydenh force-pushed the jaaydenh/workspace-creation branch from 363e6bb to 6544543 Compare April 1, 2025 22:39
@jaaydenh jaaydenh force-pushed the jaaydenh/workspace-creation branch from 636bf9c to 3ecc9d9 Compare April 2, 2025 14:49
@jaaydenh jaaydenh merged commit b60934b into main Apr 3, 2025
34 checks passed
@jaaydenh jaaydenh deleted the jaaydenh/workspace-creation branch April 3, 2025 10:14
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A user with the organizations workspace creation ban role should not see any UI to create workspaces
2 participants