Count can happen with only list permissions (#2441)

This commit is contained in:
Tomas Touceda 2021-10-07 14:25:04 -03:00 committed by GitHub
parent 4d0b19d8fb
commit 9b19e3ace6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,7 +102,7 @@ func countHostsEndpoint(ctx context.Context, request interface{}, svc fleet.Serv
}
func (svc Service) CountHosts(ctx context.Context, labelID *uint, opts fleet.HostListOptions) (int, error) {
if err := svc.authz.Authorize(ctx, &fleet.Host{}, fleet.ActionRead); err != nil {
if err := svc.authz.Authorize(ctx, &fleet.Host{}, fleet.ActionList); err != nil {
return 0, err
}