I have one page I only want certain members to have access to. This page is currently accessed by a partial view that is auto populated by checking for page nodes in my site.
I'm not sure I understand what your saying with MemberHasAccess
In my final site I am going to have one page that is only visible to members that have, for this example, a property that says Can View Page. This property will get checked to true should it meet with its required parameter but the property will be on every member.
Is there a way I can check against this "Can View Page" property in the same way in which I check to see if the page is visible?
Why don't you use the default protection of Umbraco? Right click on node public access and you can select member groups that has access and you can use the snippets in the template editors to create login forms for you.
People that don't have access will be automatically redirected to the login page. and you can use the Methods Dennnis mentioned to exclude pages from navigation.
As a bonus you get the restricted icon in the backoffice to see which pages are protected.
Restricting page access
I have one page I only want certain members to have access to. This page is currently accessed by a partial view that is auto populated by checking for page nodes in my site.
Hhere is my partial view
How can I get it so that this navigation bar is only filled with views allowed to that member?
Hi SlothMonkey,
You have to use method .MemberHasAccess(int nodeId, string path);
Methods which you show at your code snippet, just checked "umbracoNaviHide" fields for all members and not-authenticated users.
Thanks
I'm not sure I understand what your saying with MemberHasAccess
In my final site I am going to have one page that is only visible to members that have, for this example, a property that says Can View Page. This property will get checked to true should it meet with its required parameter but the property will be on every member.
Is there a way I can check against this "Can View Page" property in the same way in which I check to see if the page is visible?
Why don't you use the default protection of Umbraco? Right click on node public access and you can select member groups that has access and you can use the snippets in the template editors to create login forms for you.
People that don't have access will be automatically redirected to the login page. and you can use the Methods Dennnis mentioned to exclude pages from navigation.
As a bonus you get the restricted icon in the backoffice to see which pages are protected.
Best,
Richard
is working on a reply...