How to handle different roles with different previliges in PHP?
- by user261002
I would like to know how we can create different "user Roles" for different users in PHP.
example:
Administrator can create all types of users, add, view, manipulate data, delete managers, viewers, and workers, etc
managers can only create, workers and viewers, can add and view data,
workers can't create new users, but can only add data and view data,
viewers can only view data that has been added to the DB by workers, managers and administrators.
I though its better to use different sessions like :
$_SESSION['admin']
$_SESSION['manager']
$_SESSION['worker']
$_SESSION['viewvers']
and for every page check which of them have a true or yes value, but I want to know how do they do it in real and big projects??? is there any other way???