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 220.127.116.11
diff -r18.104.22.168 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