Tip: If you have a baseController with general access rules and actions, then you can extend this controller to have more specific actions in the extendedController.
But to be able to still use the baseController’s actions from the extendedController, you have to merge their access rules:
class extendedController extends baseController
{
public function accessRules()
{
return array_merge(
// This controller's rules are added first.
// Allow all users to call the 'hello' action.
array(
array('allow',
'actions'=>array('hello'),
'users'=>array('*'),
),
),
// BaseController rules are added last, especially
// if the last rule in the baseController denies all
// users that were not allowed yet.
parent::accessRules()
);
}
public function actionHello()
{
echo('Hello!');
}
}