Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All,
can we restrict public access for an node to with specific members programmatically ?
Any help on this would be much appreciated. Umbarco v8.11
Thanks, Gurumurthy J V
Hi Gurumurthy
I'm not super sure but there is a core service called PublicAccessService which you can use to programatically set PublicAccessRules on particular content items.
https://github.com/umbraco/Umbraco-CMS/blob/ece7008ce716029111452c80233b251802947e31/src/Umbraco.Core/Services/Implement/PublicAccessService.cs
Would that be what you are after
var publicAccessService = Services.PublicAccessService;
if you are inheriting from a special 'Umbraco' base class, eg SurfaceController, RenderMvcController etc
or you can inject IPublicAccessService via dependency injection into the constructor of a custom class.
regards
Marc
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Can we programmatically add an member to specific node? to restrict public access.
Hi All,
can we restrict public access for an node to with specific members programmatically ?
Any help on this would be much appreciated. Umbarco v8.11
Thanks, Gurumurthy J V
Hi Gurumurthy
I'm not super sure but there is a core service called PublicAccessService which you can use to programatically set PublicAccessRules on particular content items.
https://github.com/umbraco/Umbraco-CMS/blob/ece7008ce716029111452c80233b251802947e31/src/Umbraco.Core/Services/Implement/PublicAccessService.cs
Would that be what you are after
if you are inheriting from a special 'Umbraco' base class, eg SurfaceController, RenderMvcController etc
or you can inject IPublicAccessService via dependency injection into the constructor of a custom class.
regards
Marc
is working on a reply...