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.
Hi,
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.