The logic to display the group select list should use the course setting for group/grouping (like 'Show readers' does).
For group forums it would work same as now. For non-group forums it would work as follows:
- If the course does not have default group mode set (on course settings page), behave as at present (well if it was working), ie no group dropdown
- If the course does have default group mode set, show a group selector as follows:
- If current user has accessallgroups, show 'All participants' plus each individual group (or, if 'default grouping' is set too, show only groups that
are in that grouping).
- If current user doesn't have accessallgroups, show each group that the user belongs to.
Whatever we're showing, use the same 'monitor roles' logic that is already (supposed to be) in place to include only relevant roles.