mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
feat(coderd/rbac): make organization-member a per-org system custom role (#21359)
Migrated the built-in organization-member role to DB storage so it can be customized per org. Closes https://github.com/coder/internal/issues/1073 (part 1)
This commit is contained in:
@@ -568,6 +568,16 @@ func New(options *Options) *API {
|
||||
// bugs that may only occur when a key isn't precached in tests and the latency cost is minimal.
|
||||
cryptokeys.StartRotator(ctx, options.Logger, options.Database)
|
||||
|
||||
// Ensure all system role permissions are current.
|
||||
//nolint:gocritic // Startup reconciliation reads/writes system roles. There is
|
||||
// no user request context here, so use a system-restricted context.
|
||||
err = rolestore.ReconcileSystemRoles(dbauthz.AsSystemRestricted(ctx), options.Logger, options.Database)
|
||||
if err != nil {
|
||||
// Not ideal, but not using Fatal here and just continuing
|
||||
// after logging the error would be a potential security hole.
|
||||
options.Logger.Fatal(ctx, "failed to reconcile system role permissions", slog.Error(err))
|
||||
}
|
||||
|
||||
// AGPL uses a no-op build usage checker as there are no license
|
||||
// entitlements to enforce. This is swapped out in
|
||||
// enterprise/coderd/coderd.go.
|
||||
|
||||
Reference in New Issue
Block a user