Role issue with Manage Categories: Explain this behaviour?

Role issue with Manage Categories: Explain this behaviour?

by Brian Lockwood -
Number of replies: 5

Moodle 2.0: LAMP

I am interested in assigning the role Manage Categories to Course Creators. Ideally only in the context of Categories rather than System. 
This  seems to be perfectly admissable from http://docs.moodle.org/20/en/Capabilities/moodle/category:manage

In Course Creator tick Yes for manage Catgories and View Hidden Categories
A Course Creator can see Hidden Catgories but can't manage categories.
The ability to View Hidden categories can be truned on and off as expected but clicking on and off for Manage Categories seems to make no difference.

I need to get this working in a system context of I am fgoing to assign this role from within the Category context.

If I make the person into a manager the permissions seem to work OK but I do not want to promote them to a manager.

This post from Tim Hunt suggests that what I have tried should work. http://moodle.org/mod/forum/discuss.php?d=189367#p824148

This post hints at a solution but it is not completely clear to me and anyway the author hasn't actually tried it themselves(!)

http://moodle.org/mod/forum/discuss.php?d=166380#p731584

Average of ratings: -
In reply to Brian Lockwood

Re: Role issue with Manage Categories: Solved.

by Brian Lockwood -

I found the following to be true on a 2.05+ and also on a 2.1.1

Having a customer requiring this functionality I had to solve it for myself. The description in Docs for Category:Manage here so far as I can tell is wrong (or at least incomplete). The default permissions for Course Creator and Teacher relevant to this are Category:Manage; Category:See Hidden and they are set by default as follows.

Item Course Creator Editing Teacher
Category:Manage Not Set Not Set
Category:See Hidden Allow Not Set

If you go to a context and change Category Manage to Allow for a user they do not get the Manage rights for categories.

The last entry for permissions (Manage Blocks) added to the table above gives us

Item Course Creator Editing Teacher
Category:Manage Not Set Not Set
Category:See Hidden Allow Not Set

Manage Blocks on a page Not Set Allow

If you set Category:Manage AND "Manage Blocks on a page" to Allow then the user gets the Category:Manage permission you might have expected by changing only Category:Manage

Brian

In reply to Brian Lockwood

Re: Role issue with Manage Categories: Solved.

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

What  jobs do you mean by manage categories? Being able to change the details of the category and move courses up and down? Just asking because I will update the documentation (which dates from 1.9.4) unless you would like to do it yourselfsmile

In reply to Mary Cooch

Re: Role issue with Manage Categories: Solved.

by Brian Lockwood -
I mean the functionality describe where I have linked to the docs entry in my post above. I have also made a change the entry in the 2.1 docs by adding a note in the category:manage section which describes adding the capability in the permissions. To be honest; I consider it a bug as the two permissions should probably not be tied like this. Perhaps I should file a bug report. What do you Think?
In reply to Mary Cooch

Re: Role issue with Manage Categories: Solved.

by Brian Lockwood -

I have added the following message to 1.9, 2.0 & 2.1. I am putting a 2.2 on a server today and if the issue persists there I will add it to the 2.2 docs. I will also bug report it in case it is an unanticipated feature.

05012012 In order to get Category:Manage to work I needed to give the user "Manage Blocks on Page" as well. If I did not, the user was unable to "Category:Manage"

In reply to Brian Lockwood

Re: Role issue with Manage Categories: Bug report

by Brian Lockwood -

Update: Rather than adding a bug I reckon it is already reported as a minor bug http://tracker.moodle.org/browse/MDL-26840 and so I have posted the work around there. The assigned handler should be able to fix it with that info.

There is already a php code fix there but I am very reticent about putting code changes in other peoples Moodles.

Permissions must be very difficult to handle as ideally you would want the full set to work a bit like a vector space with each permission being an independent property of the user state. Principles are all very well but practicalities must always get in the way of such things and Category:Manage was a real step forward.