To the extent that this is an interesting question (and it is), and to the extent that it keeps popping up in threads (and it does, as an analogy), I think it helpfully illuminates three different styles of play.*
In the beginning, there was the idea of "skilled play." If you look back, you see that while players inhabited a role (proto-roleplaying), players were also assumed to have some skill at the game itself. That is why early modules featured puzzles and traps and riddles and so on that were meant to be solved by the players, not the PCs. And the different abilities of monsters were known (or not) by the players, not the PCs. This was so well-known that one of the earliest Dragon Magazines (before the Monster Manual!) mocks the problem and has a way for DMs to create random monsters!!!
Then we can discuss the concept of "role playing." People that were more interested in role playing became focused on the divide between the player and the PC. The player might know that a troll could be stopped by fire (having encountered one in the last campaign), but the PC might not. So the player would have to determine if the PC had that knowledge- did their history, background, intelligence, and so on, mean that they would know this? Would a noble-born Cleric know it? How about a peasant fighter recently released from the army?
Finally, there is the concept of "dice play." With the advent of later parts of 2e, and especially 3e on, their was an increased emphasis on the use of dice to resolve non-combat situations.** Here, instead of looking solely at skilled play (what the player knew) or the role play (what the PC knew), the player would determine if the PC knew that information the same way that the player would determine if the PC hit an opponent; by rolling. This made it worthwhile to invest in an applicable skill to know, um, stuff.
So we have three different outlooks on the game, and the question- SP, RP, DP. Let me start by saying that very few tables or people purely approach the game using one perspective, and freely intermingle. But looking at the question from these perspectives, we get the following answers:
SP: No. Of course not. If the player knows, fine, otherwise ....
RP: No. Again, if the player already knows, then the player can determine if the PC knows.
DP: Maybe. The player would choose an applicable skill and roll against it to determine if the player knows.
This doesn't really fully explicate the issues, however, because when people are talking about TROLLS, they are really discussing the use of "metagaming," and what that means to them. Again, I think it is helpful to look at how the three approaches, broadly defined, view metagaming (and for now, we will set aside examples of metagaming such as reading the Adventure Path ahead of time!).
SP: Metagaming that is not cheating is allowed, and part of the game.
RP: Metagaming is anathema.
DP: Metagaming is often unavoidable, but the only way to access that knowledge is through a mediated roll.
So, those are basic thoughts. Feel free to savage them!
*NO. NOT THOSE.
**I am simplifying, of course. Using dice to resolve non-combat situations has always been part of D&D. Codifying how to do it, and making it more common, was more recent, for definitions of recent that occurred over three decades ago.