Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching dashboards as a customer with entityquerycontroller #10812

Open
CalmNite opened this issue May 17, 2024 · 4 comments
Open

Searching dashboards as a customer with entityquerycontroller #10812

CalmNite opened this issue May 17, 2024 · 4 comments
Assignees
Labels
bug unconfirmed Unconfirmed bug

Comments

@CalmNite
Copy link

Hello,

I was tying out some API endpoints and i came across a bug.

  1. I logged in as a customer in the swagger-ui
  2. I searched the entity-query-controller, in the endpoint api/entitiesQuery/find
  3. I tried to retrieve all the dashboards that I'm allow to view as a client with the following query

{
"entityFields": [],
"entityFilter": { "type": "entityType", "entityType": "DASHBOARD"},
"keyFilters": [],
"latestValues": [],
"pageLink": { "page": 0, "pageSize": 10}
}

I get the following error. If i do the same as a tenant this query will work.

imagen

I might be wrong but I understand that the problem is related with dashboards not having a customer_id field in the database

@ashaforost
Copy link
Contributor

Hi @CalmNite

I tested your query on v3.6.4, and it works fine:
image
The same works with the /api/entitiesQuery/find request.

What's your thingsboard version? Is the installation valid? Maybe there were errors during an upgrade?

@CalmNite
Copy link
Author

thanks for the answer @ashaforost

I have installed a new version in a different environment following the documentation in your web.
https://thingsboard.io/docs/user-guide/install/docker/

I have selected the option for kafka. I'm using the image thingsboard/tb-postgres and done all the steps which are indicated in the provided url.
Captura de pantalla de 2024-05-17 16-02-18

In this version i get the same error but with different log. I have also tried in older version and get a similar error.

Captura de pantalla de 2024-05-17 15-57-35

Are you logging in as a tenant or a customer?
Am i doing something wrong?

@CalmNite
Copy link
Author

i have been checking the source code and i came with the answer myself. i added that code to the defaultPermissionQuery in DefaultEntityQueryRepository and now the query works perfectly

imagen

imagen

@ashaforost
Copy link
Contributor

@CalmNite

This bug was reported and verified, and the fix is planned for v3.7-3.7.1.
Thank you for reporting the issue and providing a solution!

@ashaforost ashaforost self-assigned this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unconfirmed Unconfirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants