Best Practice for making certain links on a page visible depending on the user's access. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Best Practice for making certain links on a page visible depending on the user's access. (/showthread.php?tid=44006) |
Best Practice for making certain links on a page visible depending on the user's access. - El Forum - 07-30-2011 [eluser]toymachiner62[/eluser] I have an admin area and I want to have certain links visible depending on the user's access. What is the best way to do this? Right now all I have is this code for the nav links Code: <nav> Let's say I only want the "Files" link to be visible to people with super user access. I was thinking of when a user logs in, set an access level in a session parameter and then do something like this. Code: <ol> Is that the best way to do that or is there a better way? Best Practice for making certain links on a page visible depending on the user's access. - El Forum - 07-30-2011 [eluser]brucebat[/eluser] I did it this way, I had an access level value in a database for each user. Then when a user logged in their access level was stored in a session. Heres what I have in my view to give you an idea: Code: <?php Hope that helps! |