add permissionsPlugin.hasPermissions with tests