The structure is essentially `为 [所欲] 为` (wéi [suǒ yù] wéi). A literal breakdown is “to do [that which is desired] to do”. The characters combine to mean “acting solely based on one's own desires,” with the structure emphasizing the complete and unrestrained nature of the action.
The idiom 为所欲为 is deeply critical because it stands in direct opposition to core traditional values in Chinese culture, such as social harmony (和谐 - héxié), restraint (克制 - kèzhì), and consideration for the collective. It describes an individual who has completely abandoned their social responsibilities for pure self-gratification. A useful comparison for Western learners is the phrase “to do whatever one wants.” In English, this can have a positive, empowering connotation, as in “You're free now, you can do whatever you want!” In contrast, 为所欲为 is almost exclusively negative. It does not celebrate freedom but rather condemns the abuse of it. It's closer in meaning to “to act with impunity” or “to run amok,” implying that the person's actions are harmful or at least inconsiderate, and that they believe they are above the rules that govern everyone else. This term is a powerful tool for social criticism, used to call out selfishness and abuse of power at all levels of society.
This is a common idiom used in both formal and informal contexts to express strong disapproval.
The connotation is always negative and condemnatory. It is a serious accusation.