I’m building an asp.net page that is designed to display links for a user that views the page.
The links are to reports, which have security on them, and that will be delegated as part of this site.
An SQL table will hold a record for each report that exists, with its corresponding security requirements.. I haven’t quite figured this part of the system out yet, but that’s not an issue.
When a user visits the page, I only want display the records that particular user has access to. Which leads me to my question.. What is the best way to hide/show links, based on a user login (fuzzy security her for the moment), which can handle a new report being added dynamically.
By dynamically I mean if my site has a section to create a new report link, which everyone has access to, then the front page automatically displays this new link when a user visits the page.
Simple user case:
UserA has full rights, so they log on and see 4 links on the page.
UserB has limited rights, so they log on and see 1 link on the page.
UserX creates a new report which everyone can see.
UserB logs back on and now can see 2 links.
My very first idea was labels hiding and showing, but this is dumb, but thats the general concept of what i’m after..
Hopefully this makes sense, and I look forward to your help.
Thanks!
The easiest way I can see you can do this without showing and hiding links is to get your links from database based on user.
Another way is to get links from database and filter it based on permission conditions and get dataview from it. bind dataview with your databound control (repeater, data list, bulleted list etc)
If you are looking to do it in asp.net side, you can use sitemap provider (OR dynamic sitemap provider if you are not using membership and role providers in asp.net)
hope this helps you