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

Commitb6f8edf

Browse files
committed
chore: only show license expiry warning for deployment admins
1 parent6287502 commitb6f8edf

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
@@ -573,26 +573,10 @@ type API struct {
573573
// This header is used by the CLI to display warnings to the user without having
574574
// to make additional requests!
575575
func (api*API)writeEntitlementWarningsHeader(a rbac.Subject,header http.Header) {
576-
roles,err:=a.Roles.Expand()
576+
err:=api.AGPL.HTTPAuth.Authorizer.Authorize(api.ctx,a,policy.ActionRead,rbac.ResourceDeploymentConfig)
577577
iferr!=nil {
578578
return
579579
}
580-
nonMemberRoles:=0
581-
for_,role:=rangeroles {
582-
// The member role is implied, and not assignable.
583-
// If there is no display name, then the role is also unassigned.
584-
// This is not the ideal logic, but works for now.
585-
ifrole.Identifier==rbac.RoleMember()|| (role.DisplayName=="") {
586-
continue
587-
}
588-
nonMemberRoles++
589-
}
590-
ifnonMemberRoles==0 {
591-
// Don't show entitlement warnings if the user
592-
// has no roles. This is a normal user!
593-
return
594-
}
595-
596580
api.Entitlements.WriteEntitlementWarningHeaders(header)
597581
}
598582

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp