Bug in user/view.php that shows the unenrol self button when you don't have the moodle/role:unassignself, but you do the moodle/role:assign role. To bring this more in line with how course/unenrol.php and the admin block work, it should be changed so that the button doesn't show (you get an error if you try to use it anyways.
This is a diff of my proposed fix:
RCS file: /cvsroot/moodle/moodle/user/view.php,v
retrieving revision 126.96.36.199
diff -r188.8.131.52 view.php
< (has_capability('moodle/role:assign', $coursecontext, NULL) && // I can assign roles
> ($user->id != $USER->id && has_capability('moodle/role:assign', $coursecontext, NULL) && // I can assign roles