budibase icon indicating copy to clipboard operation
budibase copied to clipboard

Display column required to be writable in view

Open mmorley0395 opened this issue 7 months ago • 3 comments
trafficstars

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:

  1. Set up a postgres source (mine had primary key and non-nullable cols set up, i removed the non-null constraint)
  2. Create a view based on your table
  3. 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. Image

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!

mmorley0395 avatar Apr 09 '25 17:04 mmorley0395

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.

ConorWebb96 avatar Apr 10 '25 07:04 ConorWebb96

I've just run into this issue myself.

Image

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.

mohagan9 avatar Jun 02 '25 16:06 mohagan9