How to check (in browser) if some operation is allowed? Common need: to hide corresponding UI element.