Securing application permissions