[Elance] Extend Sally user list by role-based filer
The user list inside the Sally backend should be extended to allow filtering by roles.
For this, the addOn should show a list of roles above the user table (it can hook into
PAGE_TITLE_SHOWN, check that the current controller is the user controller and then print the appropriate HTML inside the event listener). It must be possible to select multiple roles (which shall be combined as a conjunction, i.e. if three roles are selected, a user must be in all three groups to show up in the filtered list). The addOn can/should use a multiple-select to allow entering the roles (the select must be pre-populated with the available roles) and a button to submit the selected roles and re-filter the list (this could alternatively done by listening on the change event on the select DOM element and submit its form automatically after the list has been changed).
The actual filtering is based on hooking into
SLY_USER_FILTER_WHERE, which gets the SQL WHERE statement and must then be extended. To be properly encapsulated, the WHERE statement should not be extended by JOINs to the
pac database tables, but rather a list of user IDs (
... AND id IN (1,2,3,4,....)). The list of IDs must be retrieved by using the
pac-API (see the pac library and the matching issue). It's probably required to query the pac API multiple times, if multiple roles are selected, and then build the intersection of IDs afterwards and before injecting them into the SQL).
Target system: Sally 0.7.x -- it's not allowed to change anything inside Sally or any other addOns. Everything must happen inside this addOn.