Casting was the act of assigning a role to an actor or a person in a particular situation.
In 2267, when Spock compared the situation with Vaal and the Vaalians on Gamma Trianguli VI to the Biblical story of the Garden of Eden, James T. Kirk asked if the Vulcan was casting him in the role of Satan. Spock replied that he was not. (TOS: "The Apple")
In 2371, Garak was pleased to learn that Julian Bashir had cast him as the villain in his dreams. (DS9: "Distant Voices")