/** * Generic authorize handler for controller add actions * * @return boolean Can return both true or false. */ public function canAdd() { $result = false; if (parent::canAdd()) { return get_viwer()->admin(); } return $result; }
/** * Generic authorize handler for controller add actions * * @return boolean Can return both true or false. */ public function canAdd() { $result = false; if (parent::canAdd()) { if (version_compare(JVERSION, '1.6.0', 'ge')) { $result = JFactory::getUser()->authorise('core.create'); } else { $result = JFactory::getUser()->get('gid') > 22; } } return $result; }