Programatically change permissions

Morning folks,
We have a use case where we want to update a record so that it can’t be edited in the forest admin UI when one of the fields changes to a particular state. Is there a way of programatically changing permissiosn so that a record cannot be edited in the UI when it enters a particular “state”.

For example, if I have a lesson record with a state field and the state field has a value “ready” then we want that record to become “locked” so that noone can edit it. Is this possible ?

Thankyou Mitch

Hello @Mitchell_Lloyd,

Do you want that Forest Admin show a particular state in the frontend, or do you want to ensure that no modification can be made in the database when the record has this particular state?

Hi @GuillaumeGautreau , I want to ensure that a record cannot be modified in the database from the forest admin UI.

Ok, then the simpler is to add your logic directly in the routes that Forest Admin creates by default in your liana.

In the documentation, you’ll find how to proceed: