Moodle
  1. Moodle
  2. MDL-23728

Custom capabilities broken for "assignment type" plugins

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 2.0
    • Component/s: Assignment (2.2)
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      27125

      Description

      I am currently programming an assignment type plugin, which needs some custom capabilities. I struggled with setting these up, until I realized that Moodle tries to pick up my "access.php" file in the wrong directory location.

      Suppose that my plugin is called "myplugin".

      Expected behaviour:
      Capabilities are read from $CFG->dirroot/mod/assignment/type/myplugin/db/access.php

      Actual behaviour:
      Capabilities are read from $CFG->dirroot/assignment_type/myplugin/db/access.php

      The root problem seems to lie in lib/accesslib.php, function load_capability_def() . Probably the path name will need to be passed explicitly as a parameter here. So far, the procedure is called with "assignment_type/myplugin" as the parameter value.

        Activity

        Hide
        Petr Škoda added a comment -

        Hello,
        this is a known issue - capabilities are not supported in subplugins in 1.9.x or earlier. The (sub)plugin support was significantly improved in 2.0dev.

        Petr Skoda

        Show
        Petr Škoda added a comment - Hello, this is a known issue - capabilities are not supported in subplugins in 1.9.x or earlier. The (sub)plugin support was significantly improved in 2.0dev. Petr Skoda

          People

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

            Dates

            • Created:
              Updated:
              Resolved: