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

Capability definition should include list of contexts where usable

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7
    • 1.9.3
    • Roles / Access, Usability
    • None
    • MOODLE_17_STABLE
    • MOODLE_19_STABLE

    Description

      Currently there is a lot of confusing where each capability can be assigned, the main problem is that in CONTEXT_SYSTEM are capabilites that can be assigned everywhere but also some can be assigned only at at certain levels such (ex. blog capabilities at CONTEXT_SYSTEM only).

      I am proposing a simple rule that would make things much easier to understand, both for developers and users:

            • In capability definition (access.php file) contextlevel means the lowest level (== the highest number) where capability can be assigned. ****

      Steps to implement:
      1/ create new context level CONTEXT_ANYWHERE (any better name??) with value 100 (or higher)
      2/ review all capability definitions and fix context level - CONTEXT_SYSTEM seems to be used too often
      3/ fix role definition and overide gui to list the capabilities properly and explain the levels where each capability is applicable
      4/ add diagnostic checks in debug mode to verify that capabilities are not used on lower levels than intended - it would catch some nasty bugs

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Nobody Nobody
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Huong Nguyen, Barbara Ramiro, Bas Brands, Mathew May, David Woloszyn, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/Oct/08