Small update for hasPermission function