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

Capability definition should include list of contexts where usable

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.9.3
    • Component/s: Roles / Access, Usability
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      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

              Assignee:
              skodak Petr Skoda
              Reporter:
              skodak Petr Skoda
              Tester:
              Nobody Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Huong Nguyen, Barbara Ramiro, Bas Brands, Mathew May
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Oct/08