hugopeek / romanesco-patterns

0 stars 0 forks source link

Prevent user from editing core elements #85

Open hugopeek opened 6 years ago

hugopeek commented 6 years ago

Core elements are mixed with regular elements, but they shouldn't be edited directly as these changes would be overridden on the next core update. It would be good to have a build-in prevention for attempts to save these elements.

I can think of 2 ways to achieve this:

  1. Use the autoincrement threshold and create a plugin that checks if the ID of the element is above 100K, or...
  2. Use access controls to revoke write access in certain categories.

Both options make it possible to lock writing commands while keeping the elements visible. Hiding them could also be an option, but I think it's better for users to at least see the moving parts and maybe be able to duplicate them as well for customization. This poses a challenge for ContentBlocks btw, because the access policies there apply to all the elements at once. So an additional plugin might still be needed there if we go for option 2.