Capabilities/moodle/role:unassignself
From MoodleDocs
- This allows a user to unassign themself from a role in the given context.
- This capability is allowed for the default teacher role and not set for the default student role i.e. a student can't unenrol themself from a course.
- An "Unenrol me from the course" link exists in the course administration block for users with this capability.
To enable students to unenrol themselves from a course:
- Access Administration > Users > Permissions > Define roles
- Click the edit icon opposite the student role
- Change the unassign own roles capability from not set to allow
- Click the "Save changes" button
The role change will take effect when students next login.