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

Add unofficial support for custom context levels

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9, 2.0, 2.5.1
    • Fix Version/s: 2.6
    • Component/s: Roles / Access
    • Labels:
    • Testing Instructions:
      Hide

      1/ install attached local_testcontext plugin
      2/ add to your config.php:

      $CFG->custom_context_classes = array(12 => 'local_testcontext_bogus_context');


      3/ open role edit page and verify the new context level appeared there
      4/ reinstall your site because your context table is now invalid (or manually remove the bogus context level 12)

      Show
      1/ install attached local_testcontext plugin 2/ add to your config.php: $CFG->custom_context_classes = array(12 => 'local_testcontext_bogus_context'); 3/ open role edit page and verify the new context level appeared there 4/ reinstall your site because your context table is now invalid (or manually remove the bogus context level 12)
    • Difficulty:
      Difficult
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w36_MDL-20045_m26_customlevels
    • Story Points:
      40
    • Sprint:
      BACKEND Sprint 4

      Description

      This issue is in reference to http://moodle.org/mod/forum/discuss.php?d=111362.
      In brief, one of our Moodle extensions would benefit greatly from being able to use Moodle's roles and contexts system, and we would need to define our own context levels. However, we would like to be able to do this without having to differ from core in unmaintainable ways.
      We believe that this would be helpful to many other Moodle partners and plugin developers, and some of our proposed changes may help to improve the maintainability and readability of core Moodle code.

        Attachments

        1. remove_switch_statements.diff
          65 kB
          Hubert Chathi
        2. remove_switch_statements.diff
          67 kB
          Hubert Chathi
        3. remove_switch_statements.diff
          56 kB
          Hubert Chathi
        4. remove_switch_statements.diff
          59 kB
          Hubert Chathi
        5. testaccesslib2.php
          14 kB
          Hubert Chathi

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13