From 5545c0db635183cc4657cb5ef8bf1e828052f796 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Fri, 30 Aug 2024 03:50:15 +0000 Subject: [PATCH] chore: only show license expiry warning for deployment admins --- enterprise/coderd/coderd.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/enterprise/coderd/coderd.go b/enterprise/coderd/coderd.go index 92225f3e44ecb..9e228a8f0b206 100644 --- a/enterprise/coderd/coderd.go +++ b/enterprise/coderd/coderd.go @@ -573,26 +573,10 @@ type API struct { // This header is used by the CLI to display warnings to the user without having // to make additional requests! func (api *API) writeEntitlementWarningsHeader(a rbac.Subject, header http.Header) { - roles, err := a.Roles.Expand() + err := api.AGPL.HTTPAuth.Authorizer.Authorize(api.ctx, a, policy.ActionRead, rbac.ResourceDeploymentConfig) if err != nil { return } - nonMemberRoles := 0 - for _, role := range roles { - // The member role is implied, and not assignable. - // If there is no display name, then the role is also unassigned. - // This is not the ideal logic, but works for now. - if role.Identifier == rbac.RoleMember() || (role.DisplayName == "") { - continue - } - nonMemberRoles++ - } - if nonMemberRoles == 0 { - // Don't show entitlement warnings if the user - // has no roles. This is a normal user! - return - } - api.Entitlements.WriteEntitlementWarningHeaders(header) } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy