Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite5d4f35

Browse files
chore: only show license expiry warning for deployment admins (#14488)
1 parentfaf2452 commite5d4f35

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

‎enterprise/coderd/coderd.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -582,26 +582,10 @@ type API struct {
582582
// This header is used by the CLI to display warnings to the user without having
583583
// to make additional requests!
584584
func (api*API)writeEntitlementWarningsHeader(a rbac.Subject,header http.Header) {
585-
roles,err:=a.Roles.Expand()
585+
err:=api.AGPL.HTTPAuth.Authorizer.Authorize(api.ctx,a,policy.ActionRead,rbac.ResourceDeploymentConfig)
586586
iferr!=nil {
587587
return
588588
}
589-
nonMemberRoles:=0
590-
for_,role:=rangeroles {
591-
// The member role is implied, and not assignable.
592-
// If there is no display name, then the role is also unassigned.
593-
// This is not the ideal logic, but works for now.
594-
ifrole.Identifier==rbac.RoleMember()|| (role.DisplayName=="") {
595-
continue
596-
}
597-
nonMemberRoles++
598-
}
599-
ifnonMemberRoles==0 {
600-
// Don't show entitlement warnings if the user
601-
// has no roles. This is a normal user!
602-
return
603-
}
604-
605589
api.Entitlements.WriteEntitlementWarningHeaders(header)
606590
}
607591

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp