vendure-ecommerce/vendure

RoleService findAll list display/pagination is broken due to post query filtering

Opened this issue · 0 comments

Describe the bug
The RoleService findAll query does a post result filter that filters the available roles based on the ability of the current user to see them.

To Reproduce
Steps to reproduce the behavior:

  1. Create a user and some roles.
  2. Assign only those roles to the user
  3. Login as the user
  4. use take: 1 and sort by createdAt Asc
  5. The roles you are supposed to see are not on page 1, which is empty

Expected behavior
There are two corrections possible:

  1. the filtering should happen at the query level instead of at the post query level
  2. keep the post query filtering but reduce the totalItems by the amount of roles that are "hidden" (this is a bad workaround bc it will still lead to empty screens even though it partly fixes pagination. Solution 1 is the only viable one. )

Environment (please complete the following information):

  • @vendure/core version: 2.2.x
  • Nodejs version
  • Database (mysql/postgres etc): postgres

Additional context
Not using the Vendure admin-ui