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

Admin externalpage class for using callbacks to determine access

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Ensure $CFG->dirroot/local is writeable by webserver (so we can install example plugin)
      2. Login as admin
      3. Navigate to Plugins > Install plugins in site administration
      4. Upload local_mdl69825.zip and press Install plugin from the ZIP file
      5. Finish installation
      6. Press on Site administation
      7. Confirm you see a new setting "MDL-69825 Test"
      8. Click on MDL-69825 Test
      9. Confirm you see the message You can access it
      10. Create a new user
      11. Navigate to Users > Permissions > Site administrators in site administration
      12. Make your new user a site administrator
      13. Log out
      14. Log in as new user
      15. Press on Site administration
      16. Confirm you don't see a new setting "MDL-69825 Test"
      17. Manually navigate to $CFG->wwwroot/local/mdl69825/index.php
      18. Confirm you get an access denied error
      Show
      Ensure $CFG->dirroot/local is writeable by webserver (so we can install example plugin) Login as admin Navigate to Plugins > Install plugins in site administration Upload local_mdl69825.zip and press Install plugin from the ZIP file Finish installation Press on Site administation Confirm you see a new setting " MDL-69825 Test" Click on MDL-69825 Test Confirm you see the message You can access it Create a new user Navigate to Users > Permissions > Site administrators in site administration Make your new user a site administrator Log out Log in as new user Press on Site administration Confirm you don't see a new setting " MDL-69825 Test" Manually navigate to $CFG->wwwroot/local/mdl69825/index.php Confirm you get an access denied error
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE
    • Pull 3.10 Branch:
      MDL-69825-310
    • Pull Master Branch:

      Description

      It would be helpful to have an externalpage class to use for plugin settings pages that accepts a callback method to provide appropriate access checks (we use this frequently in Workplace)

        Attachments

          Activity

            People

            Assignee:
            pholden Paul Holden
            Reporter:
            pholden Paul Holden
            Peer reviewer:
            Marina Glancy
            Integrator:
            Adrian Greeve
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Nov/20

                Time Tracking

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