-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
-
2.7
A new API function groups_filter_users_by_course_module_visible was added in MDL-43721.
This function does not do quite what the name suggests; there are a number of ways in which a course-module can be invisible to users, but those users will still be listed. However, one of the things it does do is use the groupmembersonly option, which is being removed and incorporated into a general availability system by MDL-44070.
I propose one of the following changes to the function:
1) Remove the restriction based on groups and show users regardless of groups; the groupmembersonly function was always in 'experimental settings' so it should be legitimate to make it stop having this behaviour.
or, preferably (imo)
2) Change the restriction so that instead of using groupmembersonly it uses group mode - i.e. if the activity is set to separate groups (possibly also visible groups?), then it will only show users in those groups, otherwise it shows all users.
There is a third less good option:
3) I implement a hack in the new availability system so that we can obtain (quickly) information about only group and grouping restrictions for all users, achieving directly equivalent results - i.e. this will still work the same for existing uses of groupmembersonly, but will not handle other conditions. I think this is less consistent than 2 above.
In MDL-43721 Damyon argued that the new availability system should include a way to quickly obtain a list of the users who can access an activity. While this is indeed desirable it is not possible without rewriting the rest of the way Moodle handles access (unrelated to the new availability system) - that's probably why the existing groups_filter_users_by_course_module_visible function does not do this either! I don't see why it should be a requirement for the new availability system.
I will submit a commit that makes change (2) however this may be controversial it seems.
- blocks
-
MDL-44070 Conditional availability: Enhancements including OR conditions, plugins
-
- Closed
-