Filters in applied to role in foreman correctly show the list of hosts in the host index, but breaks functionalty of multi-select action button and displays incorrectly in the modal windows that open.
When applying filters on a role which should only be able to perform Host/managed actions on a subset of the hosts, if going to the host index, the hosts correctly list, but upon selecting an arbitrary list of the hosts in the left-hand corner checkboxes, and then clicking on the multi-select options button, and selecting something from that list, for example "Run Puppet", the modal windows that pops up and asks for confirmation incorrectly displays a list of all the hosts (with 0 selected). (see attached Capture.PNG).
Expected behaviour is that this window should ask for confirmation on selected hosts (if filters agree)
Actual behaviour is that the same host view shows up instead. inside of the confirmation window.
Steps to reproduce:
1. create a new role.
2. So that user associated with this role can login, add in the (Miscellaneous) filter section, add "view_tasks", "view_statistics", "view_plugins", "access_settings", "access_dashboard" (unlimited)
3. Add Host/managed filter, add "puppetrun_hosts", "ipmi_boot", "console_hosts", "power_hosts", "build_hosts", "destroy_hosts", "edit_hosts", "create_hosts", "view_hosts", with Search filter "hostgroup_fullname ~ appdev" (I use appdev because that applies and correctly maps to a subset of hosts, but should be something appropriate to limit the amount of hosts to which these rules apply)
4. Associate this role ONLY on a user
5. as that user, visit main host view, check in some of the hosts listed there and from the multi-select options button, click "Run Puppet"