Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * 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;
 }