In one of our projects, we have defined an Editor role with very limited rights. These editors are only able to edit specific properties of specific node types. The inspector shows these fields nevertheless, so the editor gets an exception if he changes one of that fields.
Furthermore specific tabs, groups and views should not be displayed at all for such users - eg. the NodeInfo, which needs explanation.
It would be great, to have the visibility of properties, groups, views and tabs configurable according to the roles a backend user has.
I would like to get some feedback, on if you also have this requirements and if it would be a desirable core feature.
There is already a small package implementing that feature: https://github.com/punktDe/inspectorvisibility
Especially I would like to hear your opinions on the following considerations / implementation details:
- The package uses Policies to configure the visibility. I didn’t like this approach at first, because hiding elements is not a security feature. But while trying to configure that separately, I ended up reimplementing the Policy framework completely.
- The package overwrites the configured “hidden” property, if a policy matches. If no policy matches, the configured value should not be changed. For this I need to expose the PrivilegePermissionResult to check if it only contains Abstains.