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

Inconsistent capability checks when displaying assignment submissions table.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.7.2
    • Assignment
    • None
    • MOODLE_37_STABLE

      Hi,

      There are two places where a submission can be deleted when displaying the table of submissions.

      • Item in the edit dropdown in the table
      • Item in the select box for batch operations

      If I'm not wrong, the capability checked to display these options is not the same  (in the table it's "assign:editothersubmission", in the select box it's "assign:grade".
      Since "assign:editothersubmission" is not defined by default, teachers do not see this option in the table but see it in the dropdown. The problem is that when confirming batch delete, the capability checked is "assign:editothersubmission", thus leading to a "nopermission" error. See the stack trace below.
       
      Debug info:
      Error code: nopermission
      $a contents:
       
      Stack trace:

      • line 494 of /lib/setuplib.php: moodle_exception thrown
      • line 7885 of /mod/assign/locallib.php: call to print_error()
      • line 7970 of /mod/assign/locallib.php: call to assign->remove_submission()
      • line 4893 of /mod/assign/locallib.php: call to assign->process_remove_submission()
      • line 530 of /mod/assign/locallib.php: call to assign->process_grading_batch_operation()
      • line 55 of /mod/assign/view.php: call to assign->view()

      Again if I am not wrong, simply changing the capability check at line 53 in gradingbatchoperationsform.php solved the issue.

      Regards

            Unassigned Unassigned
            jmeuriss Jean-Roch Meurisse
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 minute
                1m

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