A good example of this setup would be an Access Control List (ACL). Zend Framework (http://framework.zend.com/manual/2.0/en/modules/zend.permissions.acl.intro.html) has a permissions component implementing this type of setup. The general breakdown is that some models implement a Role interface and other models implement a Resource interface. A list (using a Registry pattern either through file configuration or in code) is created defining whether a Role can access a Resource and has a specific Privilege. I like to think of the privileges as an action list. There's lots to explore in that component.
<?php
//$acl has been previously defined and loaded
echo $acl->isAllowed('someUser', 'someResource', 'somePrivilege') ? 'yup' : 'nope'; ?>
//$user is currently not logged in and has a 'guest' role
if ($acl->isAllowed($user->getRole(), 'paidArticles', 'view') {
//Show the paid articles, secrets and all that
} else {
//Only show free articles
}
if ($acl->isAllowed($admin->getRole(), 'userList', 'delete') {
//Allow $admin to delete users from the list
} else {
//Perhaps log that someone is trying to access something they shouldn't
}
?>
While I realize this is, or could turn into a complex set of If-Thens, at some point you'll have to have a method to say, "If access is allowed, Then show X content/widget/etc". If the permissions are fairly straightforward, it should remain simple. I think the main advantage here is it allows for a pretty basic isAllowed() and gives you a true/false based on however you have the roles, resources and actions setup. Past that it's very flexible as to what you do as you query the ACL.