News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Role Based Access Control in PHP
March 13, 2012 @ 13:10:05

On PHPMaster.com today there's a new tutorial posted (from Martin Psinas) about using role-based access controls in PHP-based applications. His method isn't based in any specific framework, so it's easily portable to just about any app out there.

In this article I will discuss my personal favorite approach: role based access control (RBAC). RBAC is a model in which roles are created for various job functions, and permissions to perform certain operations are then tied to roles. A user can be assigned one or multiple roles which restricts their system access to the permissions for which they have been authorized.

He starts with a warning that, if not properly maintained, a role-based system like this can get to be somewhat chaotic so a rules should be in place around the adding and removing of permissions at certain times. His functionality is based on a few database tables - roles, permissions and cross-reference tables between users/roles & permissions/roles. All of the code you'll need to implement the system is included in a Role class, the PrivilegedUser class and the methods you'll need to add/remove/check the logged in user's permissions.

0 comments voice your opinion now!
role access privilege tutorial database permission


blog comments powered by Disqus

Similar Posts

DevShed: Developing an Extensible TCP Server with Sockets in PHP

DevShed: Polymorphism, Design Patterns, and PHP Programming

Padraic Brady's Blog: Zend Framework Blog Tutorial - Part 6: Zend_Form & Zend_Auth

MaltBlue.com: Zend Form Mastery with Zend Config - Part 1, Custom Filter Paths

PHPBuilder.com: Reading RSS feeds in PHP: Part 2


Community Events





Don't see your event here?
Let us know!


introduction series library opinion symfony release interview bugfix package tips laravel deployment voicesoftheelephpant podcast api install community framework language list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework