Permission handler updated (tests included)