administrator/components/com_categories/models/category.php
protected function canEditState($record)
	{
		$user = JFactory::getUser();

		// Check for existing category.
		if (!empty($record->id))
		{
			return $user->authorise('core.edit.state', $record->extension . '.category.' . (int) $record->id);
		}

		// New category, so check against the parent.
		if (!empty($record->parent_id))
		{
			return $user->authorise('core.edit.state', $record->extension . '.category.' . (int) $record->parent_id);
		}

		// Default to component settings if neither category nor parent known.
		return $user->authorise('core.edit.state', $record->extension);
	}
protected function canEditState($record)
	{
		$user = JFactory::getUser();

		// Check for existing category.
		if (!empty($record->id))
		{
			return $user->authorise('core.edit.state', $record->extension . '.category.' . (int) $record->id);
		}

		// New category, so check against the parent.
		if (!empty($record->parent_id))
		{
			return $user->authorise('core.edit.state', $record->extension . '.category.' . (int) $record->parent_id);
		}

		// Default to component settings if neither category nor parent known.
		return $user->authorise('core.edit.state', $record->extension);
	}
protected function canEditState ( $ record ) { $ user = JFactory :: getUser ( ) ; // Check for existing category. if ( ! empty ( $ record -> id ) ) { return $ user -> authorise ( 'core.edit.state' , $ record -> extension . '.category.' . ( int ) $ record -> id ) ; } // New category, so check against the parent. if ( ! empty ( $ record -> parent_id ) ) { return $ user -> authorise ( 'core.edit.state' , $ record -> extension . '.category.' . ( int ) $ record -> parent_id ) ; } // Default to component settings if neither category nor parent known. return $ user -> authorise ( 'core.edit.state' , $ record -> extension ) ; }
Method to test whether a record can have its state changed.

@param   object  $record  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 have its state changed .