Try our conversational search powered by Generative AI!

Read IContent access rights programmatically



Has anyone a good code snippet on how to programmatically read the access rights set on an IContent object? I would use ACL if I was working with pages, but I need it for media and block content items.



Nov 24, 2014 20:02
ISecurable securable = content as ISecurable;
if (securable == null)
ISecurityDescriptor securityDescriptor = securable.GetSecurityDescriptor();

var rights = securityDescriptor.GetAccessLevel(user);
Nov 24, 2014 22:06

Thank you, Valdis!

Nov 24, 2014 22:53

For the googlers and very curious listeners:
I ended up using 


instead, because I needed to do a role check in a filter. But I got on the right track with the provided answer.


Nov 25, 2014 10:06
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.