Read-Only Code Field for Non-Admin Users
Closed this issue · 1 comments
Is your feature request related to a problem? Please describe.
Currently, all users, regardless of their role or experience level, have write access to the Code Field provided by the Craft CMS plugin. This can lead to issues where non-programmers or non-admin users unintentionally cause errors or make changes that could compromise the integrity of the codebase. It's challenging to maintain code quality and prevent accidental modifications without restricting edit permissions.
Describe the solution you would like
I would like the plugin to include a feature where the Code Field can be set to read-only for non-admin users. This setting should be easily configurable by an admin through the plugin's settings page. The read-only mode would allow non-admin users to view the code, benefit from the syntax highlighting and autocomplete features for learning or review purposes, but prevent them from making any changes. This ensures that only users with the appropriate permissions can modify the code, thereby reducing the risk of unintended alterations.
I feel like this is something that probably should be done at the Craft CMS level. In other words, there should be a general feature for setting field-base permissions, because there are other types of fields that probably shouldn't be modifiable by certain users.
See the discussion here: craftcms/cms#8636
I bet you could implement something approximating this now using conditional fields?