René's URL Explorer Experiment


Title: Custom role editor offers workspace_dormant permissions that can never be granted · Issue #32263 · coder/coder · GitHub

Open Graph Title: Custom role editor offers workspace_dormant permissions that can never be granted · Issue #32263 · coder/coder

X Title: Custom role editor offers workspace_dormant permissions that can never be granted · Issue #32263 · coder/coder

Description: Refiling #16456, which was closed for inactivity but still reproduces on main (b4f8b6756c6a7ddddeab1664b51dea1237740a6e, v2.39.4-devel+b4f8b67). Current behavior On the custom role editor (Organization → Roles → Create custom role), turn...

Open Graph Description: Refiling #16456, which was closed for inactivity but still reproduces on main (b4f8b6756c6a7ddddeab1664b51dea1237740a6e, v2.39.4-devel+b4f8b67). Current behavior On the custom role editor (Organiza...

X Description: Refiling #16456, which was closed for inactivity but still reproduces on main (b4f8b6756c6a7ddddeab1664b51dea1237740a6e, v2.39.4-devel+b4f8b67). Current behavior On the custom role editor (Organiza...

Opengraph URL: https://github.com/coder/coder/issues/32263

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Custom role editor offers workspace_dormant permissions that can never be granted","articleBody":"Refiling #16456, which was closed for inactivity but still reproduces on `main` (`b4f8b6756c6a7ddddeab1664b51dea1237740a6e`, `v2.39.4-devel+b4f8b67`).\n\n### Current behavior\n\nOn the custom role editor (**Organization → Roles → Create custom role**), turning on **Show advanced permissions** lists every workspace action under `workspace_dormant`. Four of them can't be granted by anyone, including the site owner, so selecting any of them makes role creation fail:\n\n| `workspace_dormant` action | Result |\n| --- | --- |\n| `application_connect` | 400, not allowed to grant |\n| `share` | 400, not allowed to grant (new since #16456) |\n| `ssh` | 400, not allowed to grant |\n| `start` | 400, not allowed to grant |\n| `create`, `create_agent`, `delete`, `delete_agent`, `read`, `stop`, `update`, `update_agent` | 200 |\n\nThe API also returns only the first invalid permission, so when several are selected the user has to fix them one save at a time:\n\n```json\n{\"message\":\"Failed to update role permissions\",\"detail\":\"org=\\\"\u003corg-id>\\\": org: invalid permission for action=\\\"application_connect\\\" type=\\\"workspace_dormant\\\", not allowed to grant this permission\"}\n```\n\n### Expected behavior\n\nThe UI shouldn't offer permissions that can never be granted. If the request still fails validation, the error should list every invalid permission at once.\n\n### Steps to reproduce\n\n1. On a Premium-licensed deployment, sign in as the site owner.\n2. Go to **Admin settings → Organizations → (org) → Roles → Create custom role**.\n3. Enter a name and turn on **Show advanced permissions**.\n4. Tick the `workspace_dormant` group checkbox (or just one of `application_connect`, `share`, `ssh`, `start`).\n5. Click **Create custom role**. The request fails with the error above.\n\nTo confirm with the API, send `POST /api/v2/organizations/{org}/members/roles` as the owner with a single org permission `{\"resource_type\":\"workspace_dormant\",\"action\":\"ssh\"}`. It returns 400.\n\n### Root cause\n\n- [`policy.go`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/rbac/policy/policy.go#L157) gives `workspace_dormant` the full `workspaceActions` set, so the generated [`rbacresourcesGenerated.ts`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/site/src/api/rbacresourcesGenerated.ts#L295) includes all 12 actions.\n- With advanced permissions on, [`CreateEditRolePageView.tsx`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/site/src/pages/OrganizationSettingsPage/CustomRolesPage/CreateEditRolePageView.tsx#L208-L210) renders that full list with no filtering.\n- The owner role ([`roles.go#L427`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/rbac/roles.go#L427)) and org admin role ([`roles.go#L605`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/rbac/roles.go#L605)) intentionally get only `read, delete, create, update, stop, create_agent, delete_agent, update_agent` on dormant workspaces.\n- [`customRoleEscalationCheck`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/database/dbauthz/dbauthz.go#L1633) rejects any permission the caller doesn't hold, and [`customRoleCheck`](https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/database/dbauthz/dbauthz.go#L1646) stops at the first failure.\n\n### Possible fixes\n\n- Hide (or disable with an explanation) actions the current user can't grant. One option is for the API to expose the grantable actions per resource instead of hardcoding exclusions in the frontend.\n- Or narrow the `workspace_dormant` action list to the actions that make sense for dormant workspaces.\n- Have `customRoleCheck` collect every invalid permission and return them together.\n\n### Environment\n\n- Coder `main` @ `b4f8b6756c6a7ddddeab1664b51dea1237740a6e` (`v2.39.4-devel`), run with `scripts/develop.sh` and a Premium license\n- Originally reported against 2.18.5 and 2.19 in #16456\n\nCreated on behalf of @angrycub\n","author":{"url":"https://github.com/apps/coder","@type":"Person","name":"coder"},"datePublished":"2026-11-16T16:35:35Z","url":"https://github.com/coder/coder/issues/32263"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d25e3ee2-f55e-e3bd-51af-6143647eff58
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8548:BEE9A:98D330:D662C4:6B042D87
html-safe-nonce83ac8d3b69c0ebd29fe32618ed827f1aa2daf903792af94cfab9043163a58cd1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTQ4OkJFRTlBOjk4RDMzMDpENjYyQzQ6NkIwNDJEODciLCJ2aXNpdG9yX2lkIjoiMzU1MDg2NDU4MzEzMDYyMzM2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf7790c9f55459bfcaed1fbfdf31e1ee81d54321c9f7395e4aa5fd9a3e9907480
hovercard-subject-tagissue:6425879114
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/32263/issue_layout
twitter:imagehttps://opengraph.githubassets.com/174afce45d220d7b2fc260a641e869a1c34ac7044da3b6ba7c3543abaf83926e/coder/coder/issues/32263
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/174afce45d220d7b2fc260a641e869a1c34ac7044da3b6ba7c3543abaf83926e/coder/coder/issues/32263
og:image:altRefiling #16456, which was closed for inactivity but still reproduces on main (b4f8b6756c6a7ddddeab1664b51dea1237740a6e, v2.39.4-devel+b4f8b67). Current behavior On the custom role editor (Organiza...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecoder[bot]
hostnamegithub.com
expected-hostnamegithub.com
Noneb7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e
turbo-cache-controlno-preview
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec3dd496c3da6ea6b77e69c09279d2b81604654f1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/coder/issues/32263#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F32263
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F32263
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/issues/32263
Reloadhttps://github.com/coder/coder/issues/32263
Reloadhttps://github.com/coder/coder/issues/32263
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues322 (322)https://github.com/coder/coder/issues
Pull requests472 (472)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
https://github.com/coder/coder
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/32263
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/32263
Custom role editor offers workspace_dormant permissions that can never be grantedhttps://github.com/coder/coder/issues/32263#top
https://github.com/hwang251
good first issueEasily solved issues suitable for starters and community contributorshttps://github.com/coder/coder/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
https://github.com/apps/coder
coderhttps://github.com/apps/coder
on Nov 16, 2026https://github.com/coder/coder/issues/32263#issue-6425879114
#16456https://github.com/coder/coder/issues/16456
#16456https://github.com/coder/coder/issues/16456
policy.gohttps://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/rbac/policy/policy.go#L157
rbacresourcesGenerated.tshttps://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/site/src/api/rbacresourcesGenerated.ts#L295
CreateEditRolePageView.tsxhttps://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/site/src/pages/OrganizationSettingsPage/CustomRolesPage/CreateEditRolePageView.tsx#L208-L210
roles.go#L427https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/rbac/roles.go#L427
roles.go#L605https://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/rbac/roles.go#L605
customRoleEscalationCheckhttps://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/database/dbauthz/dbauthz.go#L1633
customRoleCheckhttps://github.com/coder/coder/blob/b4f8b6756c6a7ddddeab1664b51dea1237740a6e/coderd/database/dbauthz/dbauthz.go#L1646
Custom Role UI shows unassignable permissions #16456https://github.com/coder/coder/issues/16456
@angrycubhttps://github.com/angrycub
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Nov 16, 2026https://github.com/coder/coder/issues/32263#issuecomment-6922574949
Linear Codehttps://linear.app
ENG-3543https://linear.app/codercom/issue/ENG-3543
linear-codehttps://github.com/apps/linear-code
hwang251https://github.com/hwang251
on Nov 20, 2026https://github.com/coder/coder/issues/32263#event-36808920009
linear-codehttps://github.com/apps/linear-code
good first issueEasily solved issues suitable for starters and community contributorshttps://github.com/coder/coder/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
on Nov 20, 2026https://github.com/coder/coder/issues/32263#event-36808928111
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/coder/issues/32263
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/coder/issues/32263
hwang251https://github.com/hwang251
good first issueEasily solved issues suitable for starters and community contributorshttps://github.com/coder/coder/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.