compared with
Version 9 by Kyle Spraggs
on Aug 30, 2012 17:30.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History

h3. Setting up roles and permissions

// Creating roles manually
$foo = new \Zend\Permission\Rbac\Role('foo');
$bar = new \Zend\Permission\Rbac\Role('bar');

// Adding a child
$foo->addChild('baz'); // If a string is given creates default Role with name 'baz'

// Using Rbac container
$rbac = new \Zend\Permission\Rbac\Rbac;
$rbac->addRole($bar, array($foo)); // Add role bar with parents $foo, can also just give it a single object instead of array

// Adding permissions
var_dump($foo->hasPermission('test')); // true

// Using Rbac

h3. Dynamic assertions