Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Plan to improve ability to delegate administrator tasks to course category level

From MoodleDocs

Motivation

In a large organisation it is likely that course categories will repesent (in some sense) departments. It would be useful to be able to, effectively, have administrators assigned at the category context and for it to work logically. Some parts of this work, but a lack of underlying original functionality make this inconsistent and incomplete.

This plan is to make a few small changes to provide a better level of functionality without major changes, rewrites, or refactoring.

Partial Workaround

Creating a new role with a single capability allowed - moodle/category:update - and assigning the user to this at the site level gives them access the category and course editing screen (or it should).

Issues

Some of these were clearly bugs anyway and have been fixed, but they are noted for completeness.

Courses item in Administration not tied to capability

This has been fixed

Giving somebody the capability moodle/category:update did not give the option in the Administration menu. This has been fixed.

No capability for moving categories

Creating and deleting categories are both covered by capabilities and this is correctly reflected in the course/index.php code. However, the ability to move categories is only controlled by the moodle/category:update capability - the same one that gives you access to the page at all. There is no finer grain control available.

Proposal: Add a new capability moodle/category:move along with apropriate code in course/index.php to enforce it.

No ability to add subcategories directly

You can only add a new category at the top level even though you can assign the create permission at the category context.

Proposal: Factor out the code for this out of course/index.php into course/lib.php (functions exist for display already) and add aditionaly to course/category.php with appropriate permissions checking.

Caveat" This isn't ideal as the course/category.php script does not allow further manipulation of the category; you would have to return to the course/index.php page. However, it's much better than nothing and is an order of magnitude easier to do than a complete rewrite of the two scripts to combine them (which would be the ideal solution)

Scope

I don't think there's anything too complex or critical in here and would like to get this into 1.8.3.

See Also

The following tracker reports are related:

Discussion