Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Change ACL for MediaData


How can I change the acl for MediaData? When changing the acl for PageData I use page.ACL.CreateWritebleClone(), but MediaData doesn't expose an ACL-property. I've tried to create a ContentAccessControlList from the contentLink but an exception is thrown when I try to save it. How can this be done?

Sep 22, 2014 16:19

var writableSecurityDescriptor = (mediaData as IContentSecurable).GetContentSecurityDescriptor().CreateWritableClone() as IContentSecurityDescriptor;

//Do your modifications here

ServiceLocator.Current.GetInstance().Save(contentLink, writableSecurityDescriptor, SecuritySaveType.Replace);

Sep 23, 2014 10:11

Minor correction to Johans post; the last line should read:

ServiceLocator.Current.GetInstance<IContentSecurityRepository>().Save(contentLink, writableSecurityDescriptor, SecuritySaveType.Replace);

.. where <IContentSecurityRepository> is the Service we are using.

Cheers ;)

Jun 01, 2015 16:35
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.