rbac: add dotcom-only roles and productsubscription roles#60795
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @bobheadxi and the rest of your teammates on |
4bfe7f4 to
d398418
Compare
19ba930 to
93561ac
Compare
eseliger
left a comment
There was a problem hiding this comment.
Could we agree on the naming for the role here, so that I can make https://github.com/sourcegraph/sourcegraph/pull/60014 stack on top of this?
The goal of that PR is to decouple license mgmt from site admin for UI access, but it seems similar enough to what you're doing here :)
I would vote for "product subscriptions" and write == "can manage licenses". I think I'd like to make sure we help people remember that subscriptions as an entity exists, especially with longer-lived "subscription" traits like CG rate limits. WDYT? |
|
Makes sense to me, resembles the entity name as well. Thanks for entertaining me :) |
Currently, listing roles associated with a user on dotcom fails with the error `roles are not available on sourcegraph.com`. However, roles _are_ available on dotcom and you can configure them for users (e.g. Entitler, #60795), but there's no way to check what roles a user has with the current guard. This relaxes the restriction to allow site admins to view a user's roles. ## Test plan Test case
…lags (#60796) Removes the feature flag service account stuff, replacing it with "real RBAC" on permissions introduced in https://github.com/sourcegraph/sourcegraph/pull/60795. Cody Gateway SAs will need to use roles with these permissions. This change does **not** migrate all product-subscriptions-related CRUD to check for the new roles - it only updates the helper used by Cody Gateway related functionality. This _could_ be used with Security team's "Entitler" service to help CEs manage subscriptions and licenses if we expand the RBAC checks, at least until [RFC 885](https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q), which is still some time away. The new roles have been rolled out: https://github.com/sourcegraph/sourcegraph/pull/60796#issuecomment-1989842548
Documents https://github.com/sourcegraph/sourcegraph/pull/60796 and https://github.com/sourcegraph/sourcegraph/pull/60795. I rolled this out yesterday without issue.
…otcom-mode (#61893) See https://sourcegraph.slack.com/archives/C06TEEJLAET/p1712838707915619 (INC-292) - this should have been included as part of https://github.com/sourcegraph/sourcegraph/pull/60795 ## Test plan New integration test on `TestUpdatePermissions` for dotcom scenario to assert user perms in dotcom mode.
…otcom-mode (#61893) See https://sourcegraph.slack.com/archives/C06TEEJLAET/p1712838707915619 (INC-292) - this should have been included as part of https://github.com/sourcegraph/sourcegraph/pull/60795 ## Test plan New integration test on `TestUpdatePermissions` for dotcom scenario to assert user perms in dotcom mode.

Adds productsubscription RBAC roles (read and write), with the intent of replacing "cody gateway feature flag service account": https://github.com/sourcegraph/sourcegraph/pull/60796
This could be used with Security team's "Entitler" service to help CEs manage subscriptions and licenses, at least until RFC 885
Test plan
CI tests - the real fun is in https://github.com/sourcegraph/sourcegraph/pull/60796