fixed hasPermissions test