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

Mentee cannot access to course reports of courses with separated groups

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.6.5, 2.7.2
    • None
    • Roles / Access
    • Any
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • Hide

      1) The mentee cannot see the reports menu in the user settings (Admin block) if the course is set to separate groups.

      In lib/navigationlib.php function generate_user_settings
      change

      $canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext);
      

      for

      $canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext) || has_capability('moodle/site:accessallgroups', $usercontext);
      

      2) The mentee cannot access the user-course page if the course is also in force group mode.

      In user/view.php arround line 145
      change

      if (groups_get_course_groupmode($course) == SEPARATEGROUPS and $course->groupmodeforce
            and !has_capability('moodle/site:accessallgroups', $coursecontext) and !has_capability('moodle/site:accessallgroups', $coursecontext, $user->id)) {
      

      for

      if (groups_get_course_groupmode($course) == SEPARATEGROUPS and $course->groupmodeforce
            and !has_capability('moodle/site:accessallgroups', $coursecontext) and !has_capability('moodle/site:accessallgroups', $coursecontext, $user->id) and !has_capability('moodle/site:accessallgroups', $usercontext)) {
      

      Additionally we need to add 'moodle/site:accessallgroups' permission to parent role. Add this to the documentation wiki.

      Show
      1) The mentee cannot see the reports menu in the user settings (Admin block) if the course is set to separate groups. In lib/navigationlib.php function generate_user_settings change $canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext); for $canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext) || has_capability('moodle/site:accessallgroups', $usercontext); 2) The mentee cannot access the user-course page if the course is also in force group mode. In user/view.php arround line 145 change if (groups_get_course_groupmode($course) == SEPARATEGROUPS and $course->groupmodeforce and !has_capability('moodle/site:accessallgroups', $coursecontext) and !has_capability('moodle/site:accessallgroups', $coursecontext, $user->id)) { for if (groups_get_course_groupmode($course) == SEPARATEGROUPS and $course->groupmodeforce and !has_capability('moodle/site:accessallgroups', $coursecontext) and !has_capability('moodle/site:accessallgroups', $coursecontext, $user->id) and !has_capability('moodle/site:accessallgroups', $usercontext)) { Additionally we need to add 'moodle/site:accessallgroups' permission to parent role. Add this to the documentation wiki.
    • Easy
    • Hide

      1) Create a Parent role as is explained in https://docs.moodle.org/27/en/Parent_role
      2) Create a parent user and assign it to a student user
      3) Create a course and assign the user as student to it.
      4a) Change course settings to separate groups (to test point 1 of the description)
      4b) Change course settings and force group mode (to test point 2 of the description)

      Show
      1) Create a Parent role as is explained in https://docs.moodle.org/27/en/Parent_role 2) Create a parent user and assign it to a student user 3) Create a course and assign the user as student to it. 4a) Change course settings to separate groups (to test point 1 of the description) 4b) Change course settings and force group mode (to test point 2 of the description)

    Description

      There are two parts of the issue:

      1) The mentee cannot see the reports menu in the user settings (Admin block) if the course is set to separate groups.
      2) The mentee cannot access the user-course page if the course is also in force group mode.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pferre22 Pau Ferrer
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: