예제 #1
0
 /**
  * Method to check if you can edit a record.
  *
  * @param	array	An array of input data.
  * @param	string	The name of the key for the primary key.
  *
  * @return 	boolean
  */
 protected function _allowEdit($data = array(), $key = 'id')
 {
     // Initialise variables.
     $categoryId = (int) isset($data['catid']) ? $data['catid'] : 0;
     $user = JFactory::getUser();
     if ($categoryId) {
         // The category has been set. Check the category permissions.
         return $user->authorise('core.edit', 'com_newsfeeds.category.' . $categoryId);
     } else {
         // Since there is no asset tracking, revert to the component permissions.
         return parent::_allowEdit($data, $key);
     }
 }