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

Add the capability moodle/course:upload for tool_uploadcourse

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      I've done the testing on a clean Moodle setup.

      Step-by-step

      1. Login as admin and create a new category (Home ► Site administration ► Courses ► Add a category). It should have the id = 2, if not, please change the category ids in the provided test files (csv).
      2. Go to upload courses (Home ► Site administration ► Courses ► Upload courses) and upload the first file (upload_test.csv).
      3. Complete the upload process and verify all went correct.
      4. Then assign a second user the manager system role and login with this account (Home ► Site administration ► Users ► Permissions ► Assign system roles).
      5. Go again to the Upload courses page and upload the second file (upload_test2.csv).
      6. Complete the upload process and verify all went correct.
      7. Now remove the capability on category-context (Home ► Site administration ► Courses ► Manage courses and categories) for the new created category. Set the permission to prevent for the role Manager.
      8. Try now again to upload the course file (upload_test3.csv). Now there should be an error on the creation of the course in the second category (error_no_permission.png). But complete the Upload courses process.
      9. Please do the rollback done on step 7. Give the permissions back on this course category for the role Manager.
      10. Repeat step 8 but providing another file (upload_test4.csv and correct_overview.png).
      11. Finish the Upload process and check that both courses were created without throwing an error.
      Show
      I've done the testing on a clean Moodle setup. Step-by-step Login as admin and create a new category (Home ► Site administration ► Courses ► Add a category). It should have the id = 2, if not, please change the category ids in the provided test files (csv). Go to upload courses (Home ► Site administration ► Courses ► Upload courses) and upload the first file (upload_test.csv). Complete the upload process and verify all went correct. Then assign a second user the manager system role and login with this account (Home ► Site administration ► Users ► Permissions ► Assign system roles). Go again to the Upload courses page and upload the second file (upload_test2.csv). Complete the upload process and verify all went correct. Now remove the capability on category-context (Home ► Site administration ► Courses ► Manage courses and categories) for the new created category. Set the permission to prevent for the role Manager. Try now again to upload the course file (upload_test3.csv). Now there should be an error on the creation of the course in the second category (error_no_permission.png). But complete the Upload courses process. Please do the rollback done on step 7. Give the permissions back on this course category for the role Manager. Repeat step 8 but providing another file (upload_test4.csv and correct_overview.png). Finish the Upload process and check that both courses were created without throwing an error.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-master-MDL-43056

      Description

      With the new functionality of uploading courses via csv, I cannot see how to enable managers to upload courses in the same way as they can upload users. There is a moodle/site:uploadusers capability so would it be helpful to have a moodle/site:uploadcourses capability? (Otherwise how can managers perform this action?)

        Attachments

        1. correct_overview.png
          correct_overview.png
          13 kB
        2. error_no_permission.png
          error_no_permission.png
          17 kB
        3. MDL-43056.txt
          4 kB
        4. MDL-43056-site.txt
          3 kB
        5. Screenshot 2019-07-25 at 11.04.21.png
          Screenshot 2019-07-25 at 11.04.21.png
          125 kB
        6. upload_test.csv
          0.1 kB
        7. upload_test2.csv
          0.1 kB
        8. upload_test3.csv
          0.1 kB
        9. upload_test4.csv
          0.1 kB

          Issue Links

            Activity

              People

              • Votes:
                32 Vote for this issue
                Watchers:
                31 Start watching this issue

                Dates

                • Created:
                  Updated: