english/administrator/components/com_banners/controllers/banner.php
/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param	array	$data	An array of input data.
	 * @param	string	$key	The name of the key for the primary key.
	 *
	 * @return	boolean
	 * @since	1.6
	 */
Method override to check if you can edit an existing record.
@param       array   $data   An array of input data.
@param       string  $key    The name of the key for the primary key.


Method override to check if you can edit an existing record . @param array $data An array of input data . @param string $key The name of the key for the primary key .
protected function allowEdit($data = array(), $key = 'id')
	{
		$user		= JFactory::getUser();
		$recordId	= (int) isset($data[$key]) ? $data[$key] : 0;
		$categoryId = 0;
		if ($recordId) {
			$categoryId = (int) $this->getModel()->getItem($recordId)->catid;
		}
		if ($categoryId) {
			return $user->authorise('core.edit', $this->option.'.category.'.$categoryId);
		} else {
			return parent::allowEdit($data, $key);
		}
	}
protected function allowEdit ( $ data = array ( ) , $ key = 'id' ) { $ user = JFactory :: getUser ( ) ; $ recordId = ( int ) isset ( $ data [ $ key ] ) ? $ data [ $ key ] : 0 ; $ categoryId = 0 ; if ( $ recordId ) { $ categoryId = ( int ) $ this -> getModel ( ) -> getItem ( $ recordId ) -> catid ; } if ( $ categoryId ) { return $ user -> authorise ( 'core.edit' , $ this -> option . '.category.' . $ categoryId ) ; } else { return parent :: allowEdit ( $ data , $ key ) ; } }
Method override to check if you can edit an existing record.
Method override to check if you can edit an existing record .
// Initialise variables. // The category has been set. Check the category permissions. // Since there is no asset tracking, revert to the component permissions.