Skip to content

feat(coderd): gate org-member workspace elevation behind experiment#26027

Open
Emyrk wants to merge 1 commit into
gateway-accounts/test-subject-default-rolesfrom
gateway-accounts/floor-shrink-org-member
Open

feat(coderd): gate org-member workspace elevation behind experiment#26027
Emyrk wants to merge 1 commit into
gateway-accounts/test-subject-default-rolesfrom
gateway-accounts/floor-shrink-org-member

Conversation

@Emyrk
Copy link
Copy Markdown
Member

@Emyrk Emyrk commented Jun 3, 2026

Refs #25936. Stacks on #26003.

Gates the workspace-ops elevation on organization-member and organization-service-account behind the minimum-implicit-member experiment.

  • Experiment OFF: behavior unchanged. Both roles carry elevation + floor.
  • Experiment ON: both roles carry only the floor. The elevation lives exclusively on organization-workspace-access.
  • Read once at startup. Flip the experiment, then restart coderd.
  • Unlocks the user-facing change: removing organization-workspace-access from an org's default_org_member_roles actually removes workspace access from that org's members.
Implementation notes
  • New RoleOptions.MinimumImplicitMember mirrored into a package-level atomic.Bool in coderd/rbac/object.go (same pattern as workspaceACLDisabled / chatACLDisabled). OrgMemberPermissions and OrgServiceAccountPermissions are called from rolestore without access to api instance state, so the global is the existing escape hatch.
  • ReloadBuiltinRoles stores the value. OrgMemberPermissions and OrgServiceAccountPermissions read it via MinimumImplicitMember().
  • coderd.New reads the experiment via experiments.Enabled(codersdk.ExperimentMinimumImplicitMember) and passes it through. ReadExperiments(...) moved up so it's available before the ReloadBuiltinRoles call.
  • The conditional around ReloadBuiltinRoles widened to include the experiment, otherwise the option would never reach the rbac package on deployments that have no Disable* flags set.

Coder Agents on behalf of @Emyrk.

Copy link
Copy Markdown
Member Author

Emyrk commented Jun 3, 2026

@Emyrk Emyrk changed the title feat(coderd/rbac): floor-shrink organization-member under experiment feat(coderd): gate org-member workspace elevation behind experiment Jun 3, 2026
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch from 2bb6939 to c91e381 Compare June 3, 2026 17:13
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch from c91e381 to d1ee7c9 Compare June 3, 2026 20:48
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch 2 times, most recently from 3bf0cd9 to 4347bf4 Compare June 3, 2026 21:09
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch from d1ee7c9 to 7813b1a Compare June 3, 2026 21:09
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 4347bf4 to e4356f7 Compare June 3, 2026 21:23
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch 2 times, most recently from 210be86 to 34ec9ef Compare June 3, 2026 21:43
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch 2 times, most recently from 00b5c1f to 0988f35 Compare June 3, 2026 21:56
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch 2 times, most recently from 8e1cf4c to d46be0c Compare June 3, 2026 22:14
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 0988f35 to 27102b3 Compare June 3, 2026 22:14
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch from d46be0c to 0e1c45b Compare June 3, 2026 22:20
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from 27102b3 to e3705f7 Compare June 3, 2026 22:20
Adds RoleOptions.MinimumImplicitMember. When the
minimum-implicit-member experiment is on, OrgMemberPermissions and
OrgServiceAccountPermissions omit the workspace-ops elevation
(OrgWorkspaceAccessMemberPerms). Members of the org then only have
the floor unless granted organization-workspace-access via
default_org_member_roles or direct assignment.

Read once at startup from coderd.New. Flip the experiment, then
restart coderd.

Refs #25936.
@Emyrk Emyrk force-pushed the gateway-accounts/test-subject-default-roles branch from e3705f7 to 6c14675 Compare June 3, 2026 22:29
@Emyrk Emyrk force-pushed the gateway-accounts/floor-shrink-org-member branch from 0e1c45b to b78d140 Compare June 3, 2026 22:29
@Emyrk Emyrk marked this pull request as ready for review June 3, 2026 23:03
@Emyrk Emyrk requested a review from geokat June 4, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant