english/components/com_content/controllers/article.php
/**
	 * Method override to check if you can add a new record.
	 *
	 * @param	array	An array of input data.
	 *
	 * @return	boolean
	 * @since	1.6
	 */
Method override to check if you can add a new record.
@param       array   An array of input data.


Method override to check if you can add a new record . @param array An array of input data .
protected function allowAdd($data = array())
	{
		$user		= JFactory::getUser();
		$categoryId	= JArrayHelper::getValue($data, 'catid', JRequest::getInt('catid'), 'int');
		$allow		= null;
		if ($categoryId) {
			$allow	= $user->authorise('core.create', 'com_content.category.'.$categoryId);
		}
		if ($allow === null) {
			return parent::allowAdd();
		}
		else {
			return $allow;
		}
	}
protected function allowAdd ( $ data = array ( ) ) { $ user = JFactory :: getUser ( ) ; $ categoryId = JArrayHelper :: getValue ( $ data , 'catid' , JRequest :: getInt ( 'catid' ) , 'int' ) ; $ allow = null ; if ( $ categoryId ) { $ allow = $ user -> authorise ( 'core.create' , 'com_content.category.' . $ categoryId ) ; } if ( $ allow === null ) { return parent :: allowAdd ( ) ; } else { return $ allow ; } }
Method override to check if you can add a new record.
Method override to check if you can add a new record .
// Initialise variables. // If the category has been passed in the data or URL check it. // In the absense of better information, revert to the component permissions.