You don't.
If your app needs to do that, you instruct the user to select the text, and press C-c. We should not allow crap like this because they are too dumb to understand these instructions, or because your app is so special it just needs to do this on a click.
It certainly could make sense to have a security setting that allows this capability to be controlled, in the same sort of way as allowing sites to access your geographic location. But simply saying "we should not allow" it is unrealistic and, frankly, pretty silly.