Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59160

core_group_get_activity_allowed_groups should return if the user can access all groups

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Groups
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with group mode "Separate groups" Forced
      2. Enrol a user as a student and another user as editing teacher
      3. Create two groups, enrol both users in the only one group (the same for both)
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student and teacher user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, cmid (with the course module id of the activity not using groupings) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=125&wsfunction=core_group_get_activity_allowed_groups&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      7. Confirm that you receive a json structure containing the information of all the user groups
      8. The student should see the field canaccessallgroups set to false
      9. Te teacher should see that field set to true
      Show
      Create a course with group mode "Separate groups" Forced Enrol a user as a student and another user as editing teacher Create two groups, enrol both users in the only one group (the same for both) As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student and teacher user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, cmid (with the course module id of the activity not using groupings) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'cmid=125&wsfunction=core_group_get_activity_allowed_groups&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Confirm that you receive a json structure containing the information of all the user groups The student should see the field canaccessallgroups set to false Te teacher should see that field set to true
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59160-master

      Description

      That function should return the result of the accessallgroups capability check, we need this information to be able to show the "All groups" option to teachers when displaying interfaces with group selector.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17