Role-Based Security in php

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
rageeb
Forum Newbie
Posts: 1
Joined: Thu Mar 18, 2010 1:49 am

Role-Based Security in php

Post 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
pattern-role-based-security-schema.gif (8.2 KiB) Viewed 1324 times
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Role-Based Security in php

Post 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.
mbowersjr
Forum Newbie
Posts: 3
Joined: Wed Mar 17, 2010 2:30 am

Re: Role-Based Security in php

Post 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.
Post Reply