We want to restrict some users to access metadata field of multimedia components, is this out of box possible using users and groups ?
3 Answers
AFAIK - OOTB No, you could write an event system to check the specific schema metadata fields change while OnComponentSave event to Prevent Unauthorised Users Updating.
Update:
There are no specific API to check specific field value changed or not?, but you could detect if there are any changes in metadata XML content using args.DetectedChanges.
if (!args.DetectedChanges.ContainsKey("Metadata")) return;
var newMetadata = args.DetectedChanges["Metadata"].CurrentValue as XmlDocument;
var previousMetadata = args.DetectedChanges["Metadata"].LoadedValue as XmlDocument;
I hope it helps
-
Thanks @velmurugan for your comments, i dint see any method in api to lock down the metadata field. do you know the exact method ? Commented Feb 10, 2020 at 9:00
-
-
Thanks @Velmurgan for your help and comments, really helpfull. Just one thing from your approach that we are not disabling or locking the field, instead on compoennt save wea re checking if the metadata changed by unauthorised user then do not allow to save and throw the exception, right ? is there nay way we can lock the filed ? Commented Feb 10, 2020 at 10:25
-
@NeeleshRaghuvanshi- Yes that's what I mean, I did update my answer "Lockdown" to "check" :-) answer to your question1: yes, I'm not sure about locking the field possible,you could too validate that field using GUI Extention, refer to peter answer tridion.stackexchange.com/questions/12607/…– Velmurugan ♦Commented Feb 10, 2020 at 10:36
With regards to your comments on simply not allowing the change on the field, there used to be an extension to make fields read-only.
See Is it possible to set permissions on schema fields to restrict editing of them to certain users?
Also, there's an IDEA on this too: https://community.sdl.com/ideas/sdl-tridion-dx-ideas/i/sdl-tridion-sites-ideas/read-only-fields-per-group
Last I tried, you could try to remove read permissions on certain embedded Schema and the UI would render just the fields the user can access.
However, this has issues with mandatory fields and to me, it seems like more of a hack than a proper product feature.
There are probably a few ways to simplify or otherwise address the requirement. Specifically, it seems you want certain people to manage, edit, or otherwise review select (metadata) content related to a Multimedia Component.
Rather than a hard restriction, I would consider an update to:
- Editing process and instructions, so that the correct information is edited at the right time
- A change to the content model where the metadata information for its binary is separated, either in the linking Component or separate Components managed by a different group
- Review process, where the appropriate metadata is defined and/or reviewed outside of the CMS
A technical solution could be a good fit depending on the importance of these specific fields, though looking into the root problem and issues could be a more effective approach.
-
Yes - definitely consider putting the metadata in a separate component and linking to it. Commented Feb 14, 2020 at 9:50