protected function addRole($role, Config $rules)
{
// role has inheritance ?
if ($rules->get('inherit')) {
// role exists?
if (!array_key_exists($rules->inherit, $this->roles)) {
throw new Exception(sprintf('Role "%s" cannot inherit non-existent role "%s".
Either such role does not exist or it is set to be inherited before it is actually defined.', $role, $rules->inherit));
}
$this->acl->addRole($this->roles[$role], $this->roles[$rules->inherit]);
} else {
$this->acl->addRole($this->roles[$role]);
}
return $this;
}