Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3567

Prevent quickcourselist block from being added when user isn't allowed to use it

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 2.2.2
    • None
    • MOODLE_22_STABLE

      Hi,

      Think of a user not having the capability block/quickcourselist:use and therefore not being allowed to use the block. Anyway, this user is allowed to add the block, for example on his MyMoodle page. The block appears in editing mode, but it stays empty and disappeares when editing mode is turned off. This is somehow inconsistent. Please add something like

      function applicable_formats() {
      if (has_capability('block/quickcourselist:use', get_context_instance(CONTEXT_SYSTEM)))
      return (array('all' => true));
      else
      return (array('all' => false));

      to prevent users from adding the block when they are not allowed to use it.

      Thanks in advance.
      Alex

            aborrow Anthony Borrow
            abias Alexander Bias
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.