Try our conversational search powered by Generative AI!

Saving acess for media asset not affecting



I have set acess for some media files but its not affecting in the media folder.

var securityRepository = ServiceLocator.Current.GetInstance();

var contentReference = new ContentReference(int.Parse(key));
var folderSecurity = securityRepository.Get(contentReference).CreateWritableClone() as IContentSecurityDescriptor;
if (folderSecurity != null)
if (folderSecurity.IsInherited) folderSecurity.ToLocal();
folderSecurity.AddEntry(new AccessControlEntry("user1", AccessLevel.Read));
securityRepository.Save(contentReference, folderSecurity, SecuritySaveType.Replace);

But i saw that its saving and reflecting in Set access UI , but the folder is not showing up media folder.

Mar 17, 2016 11:04
* 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.