Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-55704

'Locally assigned roles' disabled for admin if disabled in all roles

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_31_STABLE

      Description

      To reproduce..

      • go through your roles and switch off 'activity modules' for all instances of 'Context types where this role may be assigned'.
      • now go to any activity as admin and note that 'Locally assigned roles' link has vanished from the activity's admin menu.

      For a site admin (I think) it should still be there.

      Analysis:
      The display of 'Locally assigned roles' in the navigation relies on the number of records returned from get_assignable_roles($context) being greater than zero. This in turn checks for the 'role_context_levels' table (amongst other criteria) containing entries for the relevant context level (module / 70). Because the activity modules option has been removed from all roles there are no level 70 entries at all and even the admin will get an empty array returned.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              howardsmiller Howard Miller
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: