I am throwing together a quick CRUDify app with Lift, and I need read-only access for one of the database tables.
I have researched how to remove that table’s “Create” option from the navigation menu, by setting calcCreateItem to Empty in the mapper object.
However, to make it read-only I ALSO need to remove the “Edit” and “Delete” links on each row of that table’s CRUDify form. I would like to go ahead and remove the “View” link while I’m at it (all of the table’s fields are already displayed on the List form)… but I can live with the “View” links if I have to.
Does anyone know how to make it such that records on a CRUDify “List” form do not contain the “View” / “Edit” / “Delete” links on the far-right of each row?
Kim’s IfValue solution is probably the most concise though probably not the easiest to understand for a newbie. You could also just
override def _showAllTemplateon your entity. It’s defined as below in the Crudify trait, so you could just remove the link TDs. Note that even if the links don’t appear in the template they would still be accessible so you need to block them from the SiteMenu. To do that it’s better if you just override the menu locs rather then calcCreateItem methods.