Is there any way to indicate that navigation links lead to restricted page so that users will know before they click on them?
Was thinking of either greying them out or possibly a little padlock beside them.
This could be either
- if current user doesn't have access, or
- if the page has any public access restrictions at all
Indicating links to restricted pages
Is there any way to indicate that navigation links lead to restricted page so that users will know before they click on them? Was thinking of either greying them out or possibly a little padlock beside them.
This could be either - if current user doesn't have access, or - if the page has any public access restrictions at all
I'm using version 6 in MVC mode
Thanks
Hi
when working with links you can check use HasAccess
this tells you if the current user has access to a node.
.IsProtected() tells you if the node has permissions set.
Thanks - just what I needed to know
Actually I couldn't use the item.HasAccess method mentioned above as I got a message saying it wasn't available to my model type - IPublishedContent
I've got round it by using the following helper thingy...
@if(Umbraco.MemberHasAccess(node.Id, node.Path)){ // link here } else { // do nothing or muted text, or padlock - not sure yet }
is working on a reply...