Page 1 of 1
Role-Based Security in php
Posted: Thu Mar 18, 2010 1:57 am
by rageeb
Does anybody know how to impliment a role based security in php, it's very hard to find a tutorial on role based security or any php code.I need help on this to design and impliment my own framework using php

- pattern-role-based-security-schema.gif (8.2 KiB) Viewed 1325 times
Re: Role-Based Security in php
Posted: Thu Mar 18, 2010 2:53 am
by Benjamin
You're close. Consider having a user list, a permission list, a group list and a custom permission list.
A user can be a member of a group. A group can have a specific set of permissions. Things that they can/can't access/do. Sometimes, a user may be apart of a group and need a custom permission. This could be added to a custom list which would override the permissions of the group list. The custom permission list could grant or deny specific permissions, just as the group lists.
Re: Role-Based Security in php
Posted: Thu Mar 18, 2010 2:58 am
by mbowersjr
This is a nice schema for role-based security. This design can be used in any system, not just PHP applications. If you could write up the code to implement this schema into PHP projects and maybe post the .SQL to import it as well, this would probably be widely used around the forums.
As benjamin stated, groups are the only thing this system is missing compared to most role-based systems, but the requirements of the application could determine its necessity.
Thanks, and good work.