Unable to run queries via rest api

Hi,
I am trying to run the following query via REST: http://localhost:8080/app/rest/v2/queries/crm$ProductEntity/productEntity-query?tenantId=tenant_a

<query entity="crm$ProductEntity"
       name="productEntity-query"
       view="productEntity-view">
    <jpql>
        <![CDATA[select p from crm$ProductEntity p where p.tenantId=:tenantId]]>
    </jpql>
    <params>
        <param name="tenantId"
               type="java.lang.String"/>
    </params>
</query>

I am getting permission denied.

2019-05-28 10:19:17.599 DEBUG [qtp706277948-9/app/anonymous] com.haulmont.restapi.auth.CubaRestLastSecurityFilter - REST API request [***] GET http://api.galilee.land/app/rest/v2/queries/crm$ProductEntity/productEntity-query?tenantId=tenant_a 172.23.0.11
2019-05-28 10:19:17.599 WARN  [qtp706277948-9/app/anonymous] com.haulmont.restapi.common.RestAuthUtils - Locale {} passed in the Accept-Language header is not supported by the application. It was ignored.
2019-05-28 10:19:17.600 DEBUG [qtp706277948-9/app/anonymous] com.haulmont.restapi.sys.CubaRestApiServlet - GET "/app/rest/v2/queries/crm$ProductEntity/productEntity-query?tenantId=tenant_a", parameters={masked}
2019-05-28 10:19:17.601 DEBUG [qtp706277948-9] com.haulmont.restapi.sys.CubaRestApiServlet - Completed 400 BAD_REQUEST

I gave anonymous read permission and still not working.
Any idea?
Thanks

Hi,
it should work. How did you define read permissions? Did you create a new role that grants access to the ProductEntity and assigned this role to anonymous user? Please create a sample project with roles and queries config where a problem can be reproduced.