budibase
budibase copied to clipboard
Display column required to be writable in view
Checklist
- [ x] I have searched budibase discussions and github issues to check if my issue already exists
Hosting
- Self
- Method: digital ocean
Describe the bug Based on discussions I've read, the ability for user control over which roles read/write to tables has been moved into views. Correct me if I'm wrong.
That's fine, I can create read-only views for my read-only users. However, non-nullable and display columns cannot be ticked to read only. I got rid of my non-null constraints, but the display column is still editable by my least privileged user who can only see the view. If access controls are going to be primarily in views, there needs to be a way to have full read-only views.
To Reproduce Steps to reproduce the behavior:
- Set up a postgres source (mine had primary key and non-nullable cols set up, i removed the non-null constraint)
- Create a view based on your table
- Set the permissions of your every column in your view to read only
Expected behavior I expect that if I'm making a view, it should be able to be fully read only. Instead, I can't set the display column to read only.
Screenshots
Popup appears over email column that says display column must be writable.
Desktop (please complete the following information):
- OS: Debian
- Browser chrome
EDIT: I can get around this issue by turning off edit/add/delete for that specific view. This is probably fine for my purposes but I still think this is a bug / feature worth considering fixing! Thanks!
Hey @mmorley0395,
What you’ve said here is correct.
I'm going to change this from a bug to a enhancement. What you’ve done so far is the best approach. As you mentioned, in the design area you’ll need to manually uncheck the CRUD functionality from the components.
When working with forms, there’s also a view-only type of auto-generated form that I’d recommend checking out. When generating a screen of this type, all fields are set to read-only, and no buttons are included to save or amend the record.
Since you're using Postgres, another option is to use custom queries. These allow you to specify the type of query (read, update, delete, create). In your case, selecting the "read" type means that whenever you use components like tables and forms within Budibase, the data will automatically be treated as read-only.
I've just run into this issue myself.
The age and date must be required fields, I can't change them to optional. The idea here is that only an Admin can create a row, Public users can only read rows - no creating, updating or deleting.