Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement different user level views in php [duplicate]

Possible Duplicate:
Implementing User Authorization in PHP and Javascript

I have a basic accounting system with the following users and user levels,

(User Name, Password, User Level)

A, 123, Admin

B, 456, Accountant

C, 789, Staff Member

D, 999, Manager

I need to provide them with different selected information based on their user level. For example,

-only admins have privileges of creation and deletion of user accounts

-staff only has privileges to view sales and purchasing information

-only accountants have privileges to record accounting entries

-only managers and accountants have privileges to view management reports

How can i implement this using PHP(OOP)?

Thank you.

like image 498
Rav Avatar asked Dec 26 '22 20:12

Rav


1 Answers

There are many RBAC (role based access control) implementation already. I suggest using one of those rather than creating your own:

  • http://phpmaster.com/role-based-access-control-in-php/
  • http://www.tonymarston.net/php-mysql/role-based-access-control.html
  • Role Based Access Control
like image 185
Petah Avatar answered Dec 30 '22 10:12

Petah