public function canAdd() { $result = parent::canAdd(); // FIXME: layout=form is not used anymore if ($this->getModel()->getState()->isUnique() || $this->getRequest()->query->layout === 'form') { $category = $this->getModel()->fetch(); if ($category && $category->isPermissible()) { $result = $category->canPerform('add'); } } return (bool) $result; }
public function canAdd() { // If we are on a certain category make sure user can add something here if ($this->getRequest()->query->slug) { $category = $this->getModel()->fetch(); $result = (!$category->isPermissible() || $category->canPerform('add')); } else { $result = parent::canAdd(); } return $result; }
public function canAdd() { $result = parent::canAdd(); // adding a document if (!$this->getRequest()->isGet()) { $data = $this->getRequest()->data; $category_id = !empty($data->docman_category_id) ? $data->docman_category_id : $this->getRequest()->query->get('docman_category_id', 'int'); if ($category_id) { $category = $this->getObject('com://admin/docman.model.categories')->id((int) $category_id)->fetch(); if ($category && $category->isPermissible()) { $result = $category->canPerform('add'); } } } else { if (count(self::getAuthorisedCategories(array('core.create')))) { $result = true; } } return (bool) $result; }
public function canAdd() { $result = parent::canAdd(); // FIXME: layout=form is not used anymore if ($this->getModel()->getState()->isUnique() || $this->getRequest()->query->layout === 'form') { $data = $this->getRequest()->data; $category_id = !empty($data->docman_category_id) ? $data->docman_category_id : $this->getRequest()->query->get('docman_category_id', 'int'); if ($category_id) { $category = $this->getObject('com://admin/docman.model.categories')->id((int)$category_id)->fetch(); if ($category && $category->isPermissible()) { $result = $category->canPerform('add'); } } } return (bool) $result; }
public function canAdd() { if ($this->getRequest()->getMethod() == 'GET') { $result = parent::canAdd(); } else { $data = $this->getRequest()->data; if ($category_id = $data->docman_category_id) { $category = $this->getObject('com://admin/docman.model.categories')->id((int) $category_id)->fetch(); if ($category && $category->isPermissible()) { $result = $category->canPerform('add'); } } } return (bool) $result; }