SELECT c.visible,c.startdate,r.shortname,rc.contextid,rc.permission,rc.capability,u.username,c.shortname,ra.enrol FROM mdl_user u JOIN mdl_role_assignments ra ON ra.userid = u.id JOIN mdl_role r ON ra.roleid = r.id JOIN mdl_context con ON ra.contextid = con.id JOIN mdl_course c ON c.id = con.instanceid AND con.contextlevel = 50 JOIN mdl_role_capabilities rc ON r.id=rc.id where u.username='USERNAME' and c.shortname='COURSESHORTNAME';
and see that the person has a 'capability' of 'moodle/legacy:editingteacher' for this context. The permission is 1. The visible column is 0.I am assigning roles through the external database plugin, not interactively/manually.
Thanks (and Happy New Year),
Alan