when user have no permission use flag "Accepted",how to hide it instead of when clicking and tell them "you have no permission"?

I found a function on flag.module: function template\_preprocess\_flag(&$variables) ,

but it seems not a hook to reuse...