$access_control = new \Phlopsi\AccessControl\AccessControl();
$user = $access_control->createUser('phlopsi');
$role = $access_control->createRole('admin');
$access_control->createPermission('user_management/view');
$access_control = new \Phlopsi\AccessControl\AccessControl();
$access_control->deleteUser('phlopsi');
$access_control->deleteRole('admin');
$access_control->deletePermission('user_management/view');
$access_control = new \Phlopsi\AccessControl\AccessControl();
$role = $access_control->retrieveRole('admin');
$role->addPermission('user_management/view');
$role->removePermission('user_management/view');
$access_control = new \Phlopsi\AccessControl\AccessControl();
$role = $access_control->retrieveRole('admin');
$role->addUser('phlopsi');
$role->removeUser('phlopsi');
$access_control = new \Phlopsi\AccessControl\AccessControl();
$user = $access_control->retrieveUser('phlopsi');
$has_permission = $user->hasPermission('user_management/view');
if ($has_permission) {
// Do stuff, that needs permission
} else {
// Prompt login, redirect, output error message, etc.
}
$access_control = new \Phlopsi\AccessControl\AccessControl();
$permissions = $access_control->retrievePermissionList();
$roles = $access_control->retrieveRoleList();
$users = $access_control->retrieveUserList();