Organisms that eat both producers and consumers are called omnivores. People are omnivores, and so are rats.
So, is an omnivore a primary, secondary or tertiary consumer? Well, it depends on what it's eating. If it's eating grass, it is a primary consumer. But when it's eating a rabbit, it's a secondary consumer. And when it eats a salmon (that eats insects and crustaceans), it's a tertiary or even quaternary consumer.
They're rank at their highest level of consumption. So a deer will always be a primary consumer, and an owl can be as high as a 5th level consumer.
The levels of a food chain (food pyramid) is called trophic levels. The trophic level of an organism is the level it holds in a food pyramid.
Trophic levels can be represented by numbers, starting at level 1 with plants. Further levels are numbered subsequently according to how far the organism is along the food chain.
Level 1: Plants and algae make their own food and are called primary producers.
Level 2: Herbivores eat plants and are called primary consumers.
Level 3: Carnivores which eat herbivores are called secondary consumers.
Level 4: Carnivores which eat other carnivores are called tertiary consumers.
Level 5: Apex predators which have no predators are at the top of the food chain.
Learn more about trophic levels and food chain at www.cmfri.org.in.