public function actionIndex()
{
if (!$this->_getYourCustomModel()->canViewXYZ())
{
throw $this->getErrorOrNoPermissionResponseException($errorPhraseKey);
}
}
public function actionAdd()
{
$this->_assertCanCreateXYZ();
}
protected function _assertCanCreateXYZ()
{
if (!$this->_getYourCustomModel()->canCreateXYZ($errorPhraseKey))
{
throw $this->getErrorOrNoPermissionResponseException($errorPhraseKey);
}
}