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

Capability definition should include list of contexts where usable

XMLWordPrintable

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

      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

            skodak Petr Skoda
            skodak Petr Skoda
            Nobody Nobody (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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