Users with an enrolment method, but no role

Svar: Re: Users with an enrolment method, but no role

by KS Læring -
Number of replies: 0
The "None" role for an enrolled user is discussed in

https://tracker.moodle.org/browse/MDL-29599
https://moodle.org/mod/forum/discuss.php?d=192476

and

https://docs.moodle.org/29/en/Roles_FAQ#What_is_the_.22none.22_role.3F

, but it has disappeared from the FAQ-documentation for Moodle 3.1 -

https://docs.moodle.org/31/en/Roles_FAQ

without an explanation.

Is there a difference between 2.9 and 3.1, or is this missing?

We have an "unenrol"-link at our site, but this is not available to users lacking a role in a course. This can happen either from not having been given one by some role with the capability to grant it, or by deleting all roles attached to the user in the course from the Enrolled users list of the course.

To find users in courses who do have a role of "user" rather than a role of "student" or higher, you can try this query with the Ad Hoc reporting tool to find them - enjoy. smile

SELECT user2.firstname AS Firstname, user2.lastname AS Lastname, user2.email AS Email, user2.city AS City, course.fullname AS Course, (SELECT shortname FROM prefix_role WHERE id=en.roleid AND shortname='user') AS ROLE, (SELECT name FROM prefix_role WHERE id=en.roleid AND name='') AS RoleName FROM prefix_course AS course JOIN prefix_enrol AS en ON en.courseid = course.id JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id JOIN prefix_user AS user2 ON ue.userid = user2.id