You can manipulate which properties are shown to an editor by handling a C# event which is fired just before the EditorModel is sent to the backoffice view to be rendered.
The EditorModelEventManager is still in V8, so much of this code is likely still to work, perhaps with some of the name's changed, you could reach out to the package dev Jan Van Helvoort and see if he has any plans for V8 - would like any help building one!
Restrict which fields are shown in a document type Per User Group
Is there a way in Umbraco 8 to restrict which fields are shown in a document type Per User Group?
For example a Document Type has 4 fields, a Title, Description, Taxonomy and Image.
If an Admin user logs in they can fill in all the fields but if a user in the Editor Group logs in all they see are Title and Description.
Is this possible?
Thanks
Jon
Hi Jon
You can manipulate which properties are shown to an editor by handling a C# event which is fired just before the EditorModel is sent to the backoffice view to be rendered.
It's called the SendingContentModel event:
https://our.umbraco.com/documentation/reference/events/EditorModel-Events/
The example in the docs shows setting a default value, but you could equally check the current user group and 'hide' a property etc
In fact there used to be an Umbraco V7 package that did just what you are describing: https://our.umbraco.com/packages/backoffice-extensions/hide-properties/
I'm not sure if there is a V8 equivalent - but the source code for it is here:
https://github.com/janvanhelvoort/Umbraco-hide-properties
and particularly where they utilise the SendingContentModel event:
https://github.com/janvanhelvoort/Umbraco-hide-properties/blob/develop/Source/Our.Umbraco.HideProperties/EventHandlers/EditorModelEventManagerEventHandler.cs
The EditorModelEventManager is still in V8, so much of this code is likely still to work, perhaps with some of the name's changed, you could reach out to the package dev Jan Van Helvoort and see if he has any plans for V8 - would like any help building one!
regards
marc
is working on a reply...