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

Error duplicating activity without addinstance permission

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.8, 3.1.2, 3.2
    • Fix Version/s: 3.3.8
    • Component/s: Course
    • Labels:
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE

      Description

      Users receive an error when duplicating an activity if they do not have that activity's addinstance permission.

      To reproduce:

      1. Create an activity or resource in a course - eg a Book
      2. Remove mod/book:addinstance from the Teacher role
      3. Log in as a teacher, and try to duplicate the book (using the Edit action menu). Error returned:

      error/No permission to create that activity
      Debug info: Error code: No permission to create that activity $a contents:
      Stack trace: * line 115 of /course/rest.php: moodle_exception thrown

        Attachments

          Activity

            People

            • Assignee:
              albertolarah Alberto Lara Hernández
              Reporter:
              Zoe Bogner Zoe Bogner
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/18