So far, we have seen no suggestions that the computer would refuse any such request, though. It very seldom talks back in the holodeck context, and generally only to remind the user that there is a dramatic malfunction or other technical limitation affecting the operations. Nothing suggests that Barclay would have needed to hack the system in order to reproduce Troi or Riker, either
I think we've heard the computer clap back now & then, when the request is too vague too. Those are really the only times the computer seems to get in the way of a holodeck request, malfunction, technical limitation, or prompting for clarification.
You also make a good point. The fact is, because the holodeck is a piece of Starfleet property, & linked to the ship's computer, the very fact that they can still easily conjure recreations of crew members (Like in Troi's command exam) speaks to the propriety of the act in itself, as far as they are concerned. Heck, even Moriarty, a hologram himself, was able to reproduce the crew.
We really get hung up on the 1 time that the act of reproducing crew members was used questionably by someone, compared to the number of times it's used just as freely for productive reasons... Troi's command exam, Geordi's
Identity Crisis away mission recreation, Riker's
Matter of Perspective defense. Even Geordi's creation of Leah Brahms was done for rightful intentions, & without getting too much into the unwanted topic area, his wrongfulness involving it is at least debatable, (In some other thread lol) as we only ever saw the one program of her, which was for professional purposes, & the computer algorithm is as much to blame as the user, for it getting a bit unethically overpersonal with her likeness, in that one program... maybe more so.
The point being, It's a bit unfair to judge any of the people who've done whatever they did, like Barclay, if the computer itself can just as easily trip into a slightly unethical gray area with it. For a guy like Barclay, who has some established psych issues, his entire holodeck habit could've formed over time from a similar simple misunderstanding, stemming from that possibility itself, & grew into an addiction.