Welcome Guest, Not a member yet? Register   Sign In
User Permissions
#1

[eluser]Unknown[/eluser]
I'm working on a project and I have been asked to add user permissions so an admin user can select the different sections a user has privileges for.

My thinking was have a checkbox for each of the sections. When the form is submitted add the chosen sections to an array use the PHP function serialize to store the array in the database.

And when the user logins in unserialize the array store it in the session data(encrypted), then when the user access the section check the id is in the array, if it is then permission is granted.

I wanted to see if anyone had an opinion if this was a good/bad way of doing this? I haven't actually written any code yet for this as I'm still planning it out.
#2

[eluser]Cristian Gilè[/eluser]
Yes, this is a simple and valid solution but, for my projects, I adopt Zend ACL that provides a lightweight and flexible access control list (ACL) for privileges management (http://framework.zend.com/manual/en/zend...ction.html).

Cristian Gilè
#3

[eluser]Unknown[/eluser]
Thanks Christian. Just had at the Zend ACL, looks really interesting I will keep it in mind for future project.

I think for now I will stick with my solution mainly for ease of implementation in a half built project. I wish I had known about it earlier!!




Theme © iAndrew 2016 - Forum software by © MyBB