Hide ContentForms when no write permissions

This commit is contained in:
Lucas Bartholemy 2014-03-21 14:17:42 +01:00
parent 1bfe556ec3
commit 191f861aeb

View File

@ -59,11 +59,25 @@ class ContentFormWidget extends HWidget {
* Overwrite me!
*/
public function renderForm() {
return "";
}
/**
* Checks write permissions
*/
protected function hasWritePermission() {
return $this->contentContainer->canWrite();
}
public function run() {
if (!$this->hasWritePermission())
return;
$this->renderForm();
$this->render('application.modules_core.wall.widgets.views.contentForm', array(
'form' => $this->form,
'contentContainer' => $this->contentContainer,