User does not have permission error shows up due to relationship column being set to read only on a view.
Checklist
- [x] I have searched budibase discussions and github issues to check if my issue already exists
Hosting
- Self
- Method: docker compose
- Budibase Version: 3.4.16
- App Version: 3.4.16
Describe the bug A relationship field set to read-only (via column restriction on the view) causes an error: "User does not have permission." When viewing with a custom role, a 403 error in the network tab occurs when a user with that role accesses the screen.
To Reproduce Steps to reproduce the behavior:
- Import the attached app
- Preview the app as a manager
- See the error being thrown
Expected behavior If Role X has read access to View/Table Y, which includes a relationship column (at least readable) linking to Table Z, then X must be able to fetch Z's schema.
No error should be thrown whenever viewing the forms attached to the view. The form field is read-only, but a value should be shown if you use a read/edit form block.
Screenshots
View as a manager
The form that causes the error: You can see the relationship is blank on an update type.
Network error being thrown
App Export relationship-view-issue-1740394533671.tar.gz
As discussed privately, this is either a bug with the relationship picker field hitting an API endpoint it shouldn't, or a backend issue where tables related to each other should be able to fetch each other's schema regardless of access.
I'm rewriting the entire relationship picker field because it's awful, so I'll soon see where the core problem lies.
Discussed on Linear - this is actually due to the related tables permission level and is not something that can easily be fixed (a larger piece of work is required).
Discussed this with the product team. We will remove the ability to see/interact with relationships for views where the connected table has a higher access level than the view's access level.