Beispiel #1
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	An array of input data.
  *
  * @return	boolean
  */
 protected function allowAdd($data = array())
 {
     $jinput = JFactory::getApplication()->input;
     // Initialise variables.
     $user = JFactory::getUser();
     $categoryId = JArrayHelper::getValue($data, 'catid', $jinput->getInt('catid'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the data or URL check it.
         $allow = $user->authorise('core.create', 'com_jem.category.' . $categoryId);
     }
     $jemsettings = JEMHelper::config();
     $maintainer = JEMUser::ismaintainer('add');
     $genaccess = JEMUser::validate_user($jemsettings->evdelrec, $jemsettings->delivereventsyes);
     $valguest = JEMUser::validate_guest();
     if ($maintainer || $genaccess || $valguest) {
         return true;
     }
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #2
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     $permissions = SibdietHelper::getUserPermissions();
     if (in_array('requests', $permissions) && $this->input->get('return') != 'requestschecks') {
         return parent::allowAdd();
     } else {
         return false;
     }
 }
Beispiel #3
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     $permissions = SibdietHelper::getUserPermissions();
     if (in_array('sweeteners', $permissions)) {
         return parent::allowAdd();
     } else {
         return false;
     }
 }
Beispiel #4
0
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $allow = null;
     if ($allow === null) {
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #5
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array $data An array of input data.
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     $allow = null;
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     // Access check.
     $access = JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder');
     if (!$access) {
         return false;
     }
     // In the absense of better information, revert to the component permissions.
     return parent::allowAdd($data);
 }
 /**
  * Method to check if you can add a new record.
  * Extended classes can override this if necessary.
  *
  * @param     array      $data    An array of input data.
  *
  * @return    boolean
  */
 protected function allowAdd($data = array())
 {
     if (empty($data)) {
         $context = JRequest::getCmd('filter_context');
         $item_id = JRequest::getUint('filter_item_id');
         if (empty($context) || $item_id == 0) {
             return false;
         }
     }
     return parent::allowAdd($data);
 }
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since    1.7.0
  */
 protected function allowAdd($data = [])
 {
     // Initialise variables.
     $allow = null;
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
Beispiel #9
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.0.0
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     // If the category has been passed in the URL check it.
     $allow = $user->authorise('core.create', $this->option . '.discount');
     if ($allow !== null) {
         return $allow;
     }
     // In the absense of better information, revert to the component permissions.
     return parent::allowAdd($data);
 }
Beispiel #10
0
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $allow = null;
     $allow = $user->authorise('core.create', 'com_phocagallery');
     if ($allow === null) {
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
Beispiel #11
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	An array of input data.
  *
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $allow = $user->authorise('core.create', 'com_mapfrance');
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #12
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array $data An array of input data.
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $allow = null;
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
Beispiel #13
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	$data	An array of input data.
  *
  * @return	boolean
  * 
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     // Check create access on the object.
     $result = $user->authorise('core.create', 'com_knvbapi');
     if ($result === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $result;
     }
 }
Beispiel #14
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param    array    $data    An array of input data.
  * @return    boolean
  * @since    1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $allow = null;
     $allow = $user->authorise('core.create', 'com_jdownloads');
     if ($allow === null) {
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
 /**
  * Переопределение метода для проверки,
  * может ли пользователь добавлять запись.
  *
  * @param   array  $data  Массив данных.
  *
  * @return  boolean  True, если разрешено редактировать запись.
  */
 protected function allowAdd($data = array())
 {
     // Получаем значение категории из массива.
     $categoryId = JArrayHelper::getValue($data, 'catid', JFactory::getApplication()->input->getInt('filter_category_id', 0), 'int');
     if ($categoryId) {
         // Проверка добавления на уровне категории.
         return JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
     } else {
         // Проверка добавления на уровне компонента.
         return parent::allowAdd($data);
     }
 }
 /**
  * Method to check if you can add a new record.
  *
  * @param     array      $data    An array of input data.
  *
  * @return    boolean
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $project = JArrayHelper::getValue($data, 'project_id', JRequest::getInt('filter_project'), 'int');
     $parent = JArrayHelper::getValue($data, 'parent_id', JRequest::getInt('filter_parent_id'), 'int');
     if (!$project || $parent <= 1) {
         return false;
     }
     // Validate access on the target parent directory
     if (!$user->authorise('core.create', 'com_pfrepo.directory.' . $parent)) {
         return false;
     }
     return parent::allowAdd($data);
 }
Beispiel #17
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the URL check it.
         $allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
     }
     if ($allow !== null) {
         return $allow;
     }
     // In the absense of better information, revert to the component permissions.
     return parent::allowAdd($data);
 }
Beispiel #18
0
 protected function allowAdd($data = array())
 {
     $jinput = JFactory::getApplication()->input;
     $user = JFactory::getUser();
     $categoryId = JArrayHelper::getValue($data, 'catid', (int) $jinput->get('filter_category_id', null, 'int'), 'int');
     $allow = null;
     if ($categoryId) {
         $allow = $user->authorise('core.create', 'com_bt_socialconnect.category.' . $categoryId);
     }
     if ($allow === null) {
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #19
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the data or URL check it.
         $allow = $user->authorise('core.create', 'com_content.category.' . $categoryId);
     }
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #20
0
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $app = JFactory::getApplication();
     $jInput = $app->input;
     $categoryId = JArrayHelper::getValue($data, 'parent_id', $jInput->get('parent_id'), 'int');
     $allow = null;
     if ($categoryId) {
         $allow = $user->authorise('judir.category.create', 'com_judirectory.category.' . $categoryId);
     }
     if ($allow === null) {
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #21
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $categoryId = \Hubzero\Utility\Arr::getValue($data, 'catid', Request::getInt('filter_category_id'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the URL check it.
         $allow = User::authorise('core.create', $this->option . '.category.' . $categoryId);
     }
     if ($allow === null) {
         // In the absence of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
Beispiel #22
0
 protected function allowAdd($data = array())
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $folderId = JArrayHelper::getValue($data, 'folder', $app->input->getInt('filter_folder_id'), 'int');
     $allow = null;
     if ($folderId) {
         // If Folder
         $allow = $user->authorise('core.create', $this->option . '.folder.' . $folderId);
     }
     if ($allow === null) {
         // Component Permissions
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
Beispiel #23
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	$data	An array of input data.
  * @return	boolean
  * @since	1.6
  */
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $categoryId = JArrayHelper::getValue($data, 'catid', JRequest::getInt('id'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the URL check it.
         $allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId);
     }
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd($data);
     } else {
         return $allow;
     }
 }
Beispiel #24
0
 protected function allowAdd($data = array())
 {
     // Initialise variables.
     $jinput = JFactory::getApplication()->input;
     $user = JFactory::getUser();
     $categoryId = JArrayHelper::getValue($data, 'catid', (int) $jinput->getInt('filter_category_id'), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the data or URL check it.
         $allow = $user->authorise('core.create', 'com_bt_socialconnect.category.' . $categoryId);
     }
     if ($allow === null) {
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return    boolean
  *
  * @since    1.7.0
  */
 protected function allowAdd($data = [])
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $categoryId = Joomla\Utilities\ArrayHelper::getValue($data, 'catid', JFactory::getApplication()->input->getInt('filter_category_id', 0), 'int');
     $allow = null;
     if ($categoryId) {
         // If the category has been passed in the URL check it.
         $allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId);
     }
     if ($allow === null) {
         // In the absense of better information, revert to the component permissions.
         return parent::allowAdd();
     } else {
         return $allow;
     }
 }
Beispiel #26
0
 /**
  * Method override to check if you can add a new record.
  *
  * @param	array	$data	An array of input data.
  *
  * @return	boolean
  * 
  */
 protected function allowAdd($data = array())
 {
     $user = JFactory::getUser();
     $category_id = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
     if ($category_id) {
         // If the category has been passed in the URL check create access on it and the object.
         $result = $user->authorise('core.create', 'com_knvbapi2.category.' . $category_id) and $user->authorise('core.create', 'com_knvbapi2');
         if ($result === null) {
             // In the absense of better information, revert to the component permissions.
             return parent::allowAdd($data);
         } else {
             return $result;
         }
     } else {
         // In the absense of category id, revert to the component permissions.
         return parent::allowAdd($data);
     }
 }
 /**	
  * Implement to allowAdd or not	
  *	
  * Not used at this time (but you can look at how other components use it....)	
  * Overwrites: JControllerForm::allowAdd	
  *	
  * @param array $data	
  * @return bool	
  */
 protected function allowAdd($data = array())
 {
     return parent::allowAdd($data);
 }
 /**
  * Method override to check if you can add a new record.
  *
  * @param   array  $data  An array of input data.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowAdd($data = array())
 {
     // In the absense of better information, revert to the component permissions.
     return parent::allowAdd($data);
 }