Moodle
  1. Moodle
  2. MDL-12937

Unenrol self button shows on profile, but cant complete

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: General, Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      30735

      Description

      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:

      Index: user/view.php
      ===================================================================
      RCS file: /cvsroot/moodle/moodle/user/view.php,v
      retrieving revision 1.168.2.4
      diff -r1.168.2.4 view.php
      451c451
      < (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

        Activity

        Hide
        Petr Škoda added a comment -

        fixed in cvs, thanks for the report and patch.

        Show
        Petr Škoda added a comment - fixed in cvs, thanks for the report and patch.
        Hide
        Séverin Terrier added a comment -

        The unenroll link is not present anymore when you don't have unassignself capability in latest 1.9 beta 4.
        Closing

        Show
        Séverin Terrier added a comment - The unenroll link is not present anymore when you don't have unassignself capability in latest 1.9 beta 4. Closing

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: