@@ -582,26 +582,10 @@ type API struct {
582
582
// This header is used by the CLI to display warnings to the user without having
583
583
// to make additional requests!
584
584
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 )
586
586
if err != nil {
587
587
return
588
588
}
589
- nonMemberRoles := 0
590
- for _ ,role := range roles {
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
- if role .Identifier == rbac .RoleMember ()|| (role .DisplayName == "" ) {
595
- continue
596
- }
597
- nonMemberRoles ++
598
- }
599
- if nonMemberRoles == 0 {
600
- // Don't show entitlement warnings if the user
601
- // has no roles. This is a normal user!
602
- return
603
- }
604
-
605
589
api .Entitlements .WriteEntitlementWarningHeaders (header )
606
590
}
607
591