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

Inconsistent capability checks when displaying assignment submissions table.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.7.2
    • Fix Version/s: None
    • Component/s: Assignment
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jmeuriss Jean-Roch Meurisse
                Participants:
                Component watchers:
                Damyon Wiese, Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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