The module incorporates an ideas from the alternaterbac and srbac. For example, you can try this with the Yii Framework 1.1 blog demo. Below is an example of blog configuration.
I’m facing the same problem with all the filters that I define by myself, even with this module.
I’m getting this error:
[b]Filter "application.modules.rbac.components.RbacAccessControl" is invalid. Controller "PostController" does have the filter method "filterapplication.modules.rbac.components.RbacAccessControl".
I’m getting the same error when rbac filter is defined as inline filter in the PostController:
public function filters()
{
return array(
'rbac.components.RbacAccessControl',
);
}
Try this configuration:
public function filters()
{
return array(
// 'accessControl', // controller must have a method filterAccessControl, see yii.web.CController
array('rbac.components.RbacAccessControl'),
);
}
Or you can write wrapper of RbacAccessControl in your (base)controller:
public function filterRbac($filterChain)
{
Yii::import('rbac.components.RbacAccessControl');
$filter=new RbacAccessControl;
$filter->filter($filterChain);
}
then you can define filter as:
public function filters()
{
return array(
'rbac',
);
}