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

Allow Custom Reports to be disabled by site admin

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide

      Setup

      1. Login in as admin
      2. Navigate to Reports > Report builder > Custom reports in site administration
      3. Create a new report from the Users report source
        • Make a note of the new report ID (<WWWROOT>/reportbuilder/edit.php?id=<REPORTID>) in the URL of the editor

      Manual test

      1. Navigate to General > Advanced features in site administration
      2. Untick Enable custom reports and save changes
      3. Navigate to Reports in site administration
      4. Confirm Report builder > Custom reports is not present
      5. Manually visit <WWWROOT>/reportbuilder/index.php
      6. Confirm you see an Access denied error
      7. Manually visit <WWWROOT>/reportbuilder/edit.php?id=<REPORTID>
      8. Confirm you see an Access denied error
      9. Manually visit <WWWROOT>/reportbuilder/view.php?id=<REPORTID>
      10. Confirm you see an Access denied error

      Disabling via config.php setting

      1. Navigate to General > Advanced features in site administration
      2. Tick Enable custom reports and save changes
      3. Add the following line to your site configuration file:

        $CFG->enablecustomreports = false;
        

      4. Repeat steps 3 onwards from the "Manual test"
      Show
      Setup Login in as admin Navigate to Reports > Report builder > Custom reports in site administration Create a new report from the Users report source Make a note of the new report ID ( <WWWROOT>/reportbuilder/edit.php?id=<REPORTID> ) in the URL of the editor Manual test Navigate to General > Advanced features in site administration Untick Enable custom reports and save changes Navigate to Reports in site administration Confirm Report builder > Custom reports is not present Manually visit <WWWROOT>/reportbuilder/index.php Confirm you see an Access denied error Manually visit <WWWROOT>/reportbuilder/edit.php?id=<REPORTID> Confirm you see an Access denied error Manually visit <WWWROOT>/reportbuilder/view.php?id=<REPORTID> Confirm you see an Access denied error Disabling via config.php setting Navigate to General > Advanced features in site administration Tick Enable custom reports and save changes Add the following line to your site configuration file: $CFG->enablecustomreports = false; Repeat steps 3 onwards from the "Manual test"

      Site admins can only prevent users from accessing to Custom Reports with capabilities but they can't disable the functionality completely.

      This improvement is to introduce a setting to allow Site Admins to disable Custom Reports feature completely. I suggest the following:

      1. Add a new settings page for Report Builder. Site Administration / Reports / Report Builder / Report Builder settings
        • Edit: use standard location for feature switches (General > Advanced features)
      2. Add a new setting: Enable Custom reports ('enablecustomreports'), default = Yes.
      3. This new setting must be supported in config.php, to allow disabling Custom reports via the config file.

      When "Enable custom reports" is not enabled:

      1. Don't allow access to Custom reports and raise an error in "/reportbuilder/index.php": "Custom reports are not enabled"
        • Edit: use standard access denied messages from adminlib, existing exception messages
      2. Disable scheduled reports

        1. Disabling via config.php setting_Screenshot.png
          168 kB
          Gladys Basiana
        2. image-2022-01-17-12-37-27-154.png
          81 kB
          Emilio Lozano
        3. image-2022-01-17-12-37-56-724.png
          12 kB
          Emilio Lozano
        4. image-2022-01-17-12-38-02-426.png
          12 kB
          Emilio Lozano
        5. Manual Test_Screenshot.png
          171 kB
          Gladys Basiana
        6. Screenshot_2022-01-19 Moodle Master Administration Advanced features.png
          10 kB
          Paul Holden

            pholden Paul Holden
            emiliolozano Emilio Lozano
            Simey Lameze Simey Lameze
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 21 minutes
                4h 21m

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