I am using MVCSiteMapProvider, v4.6.1
This is my issue: I have a section of my menu that is visible only to Administrators. I achieve this by enabling security trimming and decorating my controllers and/or controller methods to define the trimming criteria.
AdminTasks
- Add
- Edit
- Remove
What I need to do is to make the "AdminTasks" node non-clickable, but still visible only to administrators.
The behavior I am observing is that, if I mark "AdminTasks" as clickable="false"
in the sitemap, the node show for everyone, regardless the user is an admin or not. It seems like, in nodes marked clickable='false'
there is no security trimming performed.
It is my assumption, without exploring the code too much, that when the node is marked clickable='false'
, SiteMapProvider doesn't attempt to resolve any route (since it is not needed anyway for navigation purposes); but in doing so, it doesn't inspect the decorations in the controllers, therefore skipping security trimming.
Is my assumption correct? Is there any way to have a non-clickable node that still is security trimmed?
Thanks