MDL-31830 course management: fixed edit category URL
MDL-31830 course management: tidied up capability checking