- moodle/category:create
- moodle/category:delete
- moodle/category:update
- moodle/category:visibility
- moodle/category:manage
The reason it is buggy is because actually it is very hard to work out whether operations like moving a category from one place to another should be allowed. With separate capabilities, it needs to be something like 'you need update in the category being moved, and you need delete in the old parent category, and you need create in the new parent category'. Yuck. Also, with separate capabilities, there are many more things that a user might be able to do that they cannot undo, which is dangerous.
Note that moodle/category:delete does not carry great risk of data-loss. There is a separate capability moodle/course:delete. If you can delete courses, then when you delete a category, you are given the choice of whether to delete all the courses in it, or move them to another category. If you are not allowed to delete courses, then when you delete category, you are forced to choose another category to move the courses too. (Oh, but what happens if there is no other category where you have moodle/course:create. Arrgh!)
So, anyway, while I can see the point of having separate course create/update/delete capabilities (for example, by default, only Admin has delete, Course creator has add too, and Teacher has update) I think it is total overkill for categories. And I have all these bugs to fix, and it is bad enough as it is!