@inherits Umbraco.Web.Mvc.UmbracoViewPage
@using Umbraco.Core.Services
@{
var memberId = 1;
var member = Membership.GetUser(memberId);
var access = ApplicationContext.Services.PublicAccessService.HasAccess(Model.Path, member, Roles.Provider);
}
Ordinarily advice is you should avoid using the services in views, but this is all the MemberHasAccess helper actually does.
I would also wrap this in some helper code, it doesn't seem very neat to leave in a razor view.
What replaces Access.HasAccces(<NodeID>,<MemberID>)
Hi just wondering what replaces Access.HasAccces(
I'm doing an upgrade from 4->7 and it is deprecated and I'd like to know how to query access for an arbitrary member id thanks :)
Hi
there is an umbraco helper method you can use in views
but if you want to do it for named users - you need to use the PublicAccessService.
as an example.
Ordinarily advice is you should avoid using the services in views, but this is all the MemberHasAccess helper actually does.
I would also wrap this in some helper code, it doesn't seem very neat to leave in a razor view.
is working on a reply...