english/administrator/components/com_categories/models/category.php
/**
	 * Method to test whether a record can be deleted.
	 *
	 * @param	object	A record object.
	 * @return	boolean	True if allowed to change the state of the record. Defaults to the permission set in the component.
	 * @since	1.6
	 */
Method to test whether a record can be deleted.
@param       object  A record object.
@return      boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
Method to test whether a record can be deleted . @param object A record object . @return boolean True if allowed to change the state of the record . Defaults to the permission set in the component .
protected function canEditState($record)
	{
		$user = JFactory::getUser();
		if (!empty($record->id)) {
			return $user->authorise('core.edit.state', $record->extension.'.category.'.(int) $record->id);
		}
		else if (!empty($record->parent_id)) {
			return $user->authorise('core.edit.state', $record->extension.'.category.'.(int) $record->parent_id);
		}
		else {
			return $user->authorise('core.edit.state', $record->extension);
		}
	}
protected function canEditState ( $ record ) { $ user = JFactory :: getUser ( ) ; if ( ! empty ( $ record -> id ) ) { return $ user -> authorise ( 'core.edit.state' , $ record -> extension . '.category.' . ( int ) $ record -> id ) ; } else if ( ! empty ( $ record -> parent_id ) ) { return $ user -> authorise ( 'core.edit.state' , $ record -> extension . '.category.' . ( int ) $ record -> parent_id ) ; } else { return $ user -> authorise ( 'core.edit.state' , $ record -> extension ) ; } }
Method to test whether a record can be deleted.
Method to test whether a record can be deleted .
// Check for existing category. // New category, so check against the parent. // Default to component settings if neither category nor parent known.