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

The function user_can_assign() in accesslib.php always returns false for administrators.

XMLWordPrintable

    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • wip-MDL-37026-master
    • Hide

      Test pre-requisites

      • A course with students enrolled in it.

      Test steps

      1. Navigate to the participants page of a course with students in it as the administrator.
        • Observe an icon for editing which will redirect you to the enrolment page.
      2. Change the current role to 'Teacher' or 'Student'.
        • The edit icon should still be present on the page.
      Show
      Test pre-requisites A course with students enrolled in it. Test steps Navigate to the participants page of a course with students in it as the administrator. Observe an icon for editing which will redirect you to the enrolment page. Change the current role to 'Teacher' or 'Student'. The edit icon should still be present on the page.

      While fixing an issues with icons I discovered that the edit icon for assigning roles on the participants page was not enabled for the administrator.

      After some further investigation I discovered the area where the problem lies.
      user_can_assign() calls get_user_roles(). get_user_roles() does a search on the role_assignments table which administrators are not entered into. It finds no records and so no permission is given for assigning roles.

      A change needs to be made in either of these functions (both in accesslib.php) to check for administrators.

            abgreeve Adrian Greeve
            abgreeve Adrian Greeve
            Dan Poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Michael de Raadt Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.