CodeIgniter Forums
Implementing permission issues - 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: Implementing permission issues (/showthread.php?tid=47828)



Implementing permission issues - El Forum - 12-23-2011

[eluser]Unknown[/eluser]
Hi all

I am new to CI.I am planning to implement user levels and permissions.I checked some libraries in CI but none of them suites my requirements.So I started with my own.

I have issues in this.I have 4 different user types and 2 user types is having different levels and permissions in the system.I have added all permissions in the db based on the levels along with module/controller(CI) name.


Issues

When I am logging into the system,I need to check whether a user type have any permission in the system.I am able to get the type from the db.But Where I should write the code (controller constructor or hooks).I checked hooks and not getting an idea.Should I devlop a library and apply hooks.I am entirely new to CI.

If any user logging into the system,I need to display that user pages and his/her permissions in the page (For eg: sales person can read the items but manager can create and read the items).How to check these conditions in each controller in an efficient way ?

I am open to all ideas


Regards
Atc