Try our conversational search powered by Generative AI!

Is there a way to get the restrictions of a content using ContentReference?

Vote:
 

I have defined several restrictions for pages in CMS.

I am having a list of ContentReferences of the pages.

How can I get their restrictions programmatically?

Note: I do not need to pass a user and check whether that user has access to that page or not, instead I need to know what are the restrictions defined for a particular page using ContentReference.

#217444
Feb 24, 2020 10:58
Vote:
 

Restrictions? Like this?

EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentSecurityRepository>().Get(ContentReference.StartPage).Entries;
#217448
Feb 24, 2020 11:46
Vote:
 

@Tomas Hensrud Gulla yes. That's what I was looking for. Thanks !!

#217519
Feb 25, 2020 4:23
- Feb 25, 2020 5:53
Excellent! :-)
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.