Hi,
Using c# how can I get a list of the Roles assigned to a page - I have set up Public Access roles using the CMS but not sure how I can get this list of roles into an object?
I'm pretty sure you would have to map the roles to an object yourself, manually. I'm not sure if this will help you but I'm guessing you want to check if a member has access to a certain page. If this is the case you could approach it from a different angle...
if (Umbraco.MemberHasAccess(content.Id, content.Path))
{
//Do something
}
What's the current alternative to GetAccessingMembershipRoles?
Because umbraco 7.6 highlights umbraco.cms.businesslogic.web.Access as obsolete and tells to use IPublicAccessService
I was unable to find out how to use it, all I got to was
Get Page Roles
Hi, Using c# how can I get a list of the Roles assigned to a page - I have set up Public Access roles using the CMS but not sure how I can get this list of roles into an object?
jon
Hi Jonathan,
I'm pretty sure you would have to map the roles to an object yourself, manually. I'm not sure if this will help you but I'm guessing you want to check if a member has access to a certain page. If this is the case you could approach it from a different angle...
Hopefully that helps :)
Hi, Thanks for the reply - unfortunately we don't want to check if they have access but we do need the list of Permitted user groups for that page.
Hi,
This should work...
Thanks!
Perfect - that's exactly what I wanted - thanks
Jon
What's the current alternative to
GetAccessingMembershipRoles
? Because umbraco 7.6 highlightsumbraco.cms.businesslogic.web.Access
as obsolete and tells to useIPublicAccessService
I was unable to find out how to use it, all I got to was
which doesn't have any information about the current page roles.
is working on a reply...