Conditional Permissions based on date

On my platform there is a content type “entry” which has a date field: deadline.
Admins and Editors have different permissions on “entries”, admins can can change titles, descriptions.
Editors can only add new rows to a structure field.

I was able to solve this by using conditional blueprints with a plugin, I check which role the user has and load a different blueprint.

Now: when the deadline has passed, the editors shall not be able to add more rows to the structure field, it should be read only, how can I solve this?

I tried the same approach with the plugin, but’s it’s very “hacky” to load a page by the current url requested in the panel, also that code in the plugin is run multiple times. Is there a cleaner way to do this? Maybe by overriding a specific method in a model?

What you could do:

  1. Create a custom field that extends the structure field (give it a new name), as in this example
  2. Instead of the default value, adapt the disabled prop to make it understand query language
  3. Create a page method/page model method that returns a boolean based on date and use that in your query string
1 Like

I went with 1.) and it works, thank you so much, much easier approach!