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

Cannot edit file with access controlled link to MS OneDrive repo

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-83341-404
    • MDL-83341-405
    • MDL-83341-main
    • Hide

      Copied from MDLQA-19229

      This test requires three OneDrive accounts: one for the site, one for the student and one for the teacher.

      Note: It is important to completely log out of all OneDrive accounts between separate parts of the test, or Microsoft will pick a random account to display the file as. Alternatively, use a different browser session for each user/OneDrive account. Let's refer to these accounts as MS1 (for the admin), MS2 (for the student), and MS3 (for the teacher).

      Setup
      1. Log in as an admin and set up and configure the OAuth 2 Microsoft service with a client ID and secret, as described in the documentation OAuth2 Services and OAuth 2 Microsoft service. Essentially,
        1. Sign up for an Azure account.
        2. Login to your Azure portal
        3. Search for or open the Microsoft Entra ID service.
        4. On the Default Directory page, expand the "Manage" submenu and select "App registrations"
        5. Click "New registration"
        6. Enter your app name
        7. For "Supported account types", select "Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)".
        8. For the "Redirect URI", enter: "YOUR_MOODLE_URL/admin/oauth2callback.php" (No need to expose your test site over the internet like using ngrok. A localhost address is fine)
        9. Take note of the "Application (client) ID". This will be used later for the "Client ID" when setting up the Microsoft OAuth 2 service.
        10. Click on the app registration that you created.
        11. Under Manage, click "Authentication"
        12. You may want to add the URI for admin/oauth2callback.php for the other Moodle instances you will test. Make sure to save your changes.
        13. Under Manage, select "Certificates and secrets"
        14. Create a new client secret.
        15. The secret's value will only be shown once, so take note of it. This will be used later for the "Client secret" when setting up the Microsoft OAuth 2 service.
      2. On your Moodle site, log in as admin
      3. Go to Site administration > Server > OAuth 2 services.
      4. Create a new Microsoft service.
      5. Fill out the Client ID and Client secret fields.
      6. Save the changes.
      7. On the OAuth2 services page, connect to a system account for your created Microsoft service using MS1.
      8. Reload the OAuth2 services page and check that the Microsoft service is still connected to the system account.
      9. Go to Site admin > Plugins > Authentication > Manage authentication plugins.
      10. Enable the OAuth2 authentication plugin.
      11. Go to Site admin > Plugins > Repositories > Manage repositories.
      12. Enable the OneDrive repository, making sure it is connected to the Microsoft service.
      13. Set the supported files to "Internal and External.
      14. Set "Default return type" to "External"
      15. Save the changes.
      16. Go to Site admin > Users > Define roles,
      17. Edit the editingteacher role to allow "mod/assign:editothersubmission" (capability not enabled by default)
      18. Log in as a teacher and create an assignment requiring a file upload.
      19. Log in as a student, select a document from your OneDrive account and select 'Create an access controlled link to the file'.
      20. Log out of all OneDrive accounts.
      21. Log in as the teacher again and access the assignment. Click on the link. Verify that you are prompted to log in to your OneDrive account.
      22. Log in with a different account from the student who submitted the assignment. Verify you can edit the student's document.
      23. Add a few comments to the student's document.
      24. Log out of all OneDrive accounts.
      25. Log in as the student, access your assignment, and verify that you see the teacher's comments in the returned OneDrive doc.
      26. As the student, go to your personal OneDrive and verify the original document has not been altered.
      Show
      Copied from MDLQA-19229 This test requires three OneDrive accounts: one for the site, one for the student and one for the teacher. Note: It is important to  completely log out of all OneDrive accounts  between separate parts of the test, or Microsoft will pick a random account to display the file as. Alternatively, use a different browser session for each user/OneDrive account. Let's refer to these accounts as MS1 (for the admin), MS2 (for the student), and MS3 (for the teacher). Setup Log in as an admin and set up and configure the OAuth 2 Microsoft service with a client ID and secret, as described in the documentation  OAuth2 Services  and  OAuth 2 Microsoft service . Essentially, Sign up for an Azure account. Login to your Azure portal Search for or open the Microsoft Entra ID service. On the Default Directory page, expand the " Manage " submenu and select " App registrations " Click " New registration " Enter your app name For " Supported account types ", select " Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) ". For the " Redirect URI ", enter: " YOUR_MOODLE_URL/admin/oauth2callback.php " (No need to expose your test site over the internet like using ngrok. A localhost address is fine) Take note of the " Application (client) ID ". This will be used later for the " Client ID " when setting up the Microsoft OAuth 2 service. Click on the app registration that you created. Under Manage, click " Authentication " You may want to add the URI for admin/oauth2callback.php for the other Moodle instances you will test. Make sure to save your changes. Under Manage, select " Certificates and secrets " Create a new client secret. The secret's value will only be shown once, so take note of it. This will be used later for the " Client secret " when setting up the Microsoft OAuth 2 service. On your Moodle site, log in as admin Go to Site administration > Server > OAuth 2 services. Create a new Microsoft service. Fill out the Client ID and Client secret fields. Save the changes. On the OAuth2 services page, connect to a system account for your created Microsoft service using MS1. Reload the OAuth2 services page and check that the Microsoft service is still connected to the system account. Go to Site admin > Plugins > Authentication > Manage authentication plugins. Enable the OAuth2 authentication plugin. Go to Site admin > Plugins > Repositories > Manage repositories. Enable the OneDrive repository, making sure it is connected to the Microsoft service. Set the supported files to " Internal and External . Set " Default return type " to " External " Save the changes. Go to Site admin > Users > Define roles, Edit the editingteacher role to allow  " mod/assign:editothersubmission "  (capability not enabled by default) Log in as a teacher and create an assignment requiring a file upload. Log in as a student, select a document from your OneDrive account and select 'Create an access controlled link to the file'. Log out of all OneDrive accounts. Log in as the teacher again and access the assignment. Click on the link. Verify that you are prompted to log in to your OneDrive account. Log in with a different account from the student who submitted the assignment. Verify you can edit the student's document. Add a few comments to the student's document. Log out of all OneDrive accounts. Log in as the student, access your assignment, and verify that you see the teacher's comments in the returned OneDrive doc. As the student, go to your personal OneDrive and verify the original document has not been altered.
    • Hide

      Code verified against automated checks.

      Checked MDL-83341 using repository: https://github.com/HuongNV13/moodle.git

      More information about this report

      Built on: Tue 10 Dec 2024 03:18:30 AM UTC

      Show
      Code verified against automated checks. Checked MDL-83341 using repository: https://github.com/HuongNV13/moodle.git MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-83341-404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-83341-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-83341-main | CI Job ] More information about this report Built on: Tue 10 Dec 2024 03:18:30 AM UTC
    • Show
      Launching automatic jobs for branch MDL-83341 -404 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17645/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60117/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60118/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-83341 -405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17646/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60119/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60120/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-83341 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17647/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60121/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60122/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60123/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/60124/ App tests (stable app version) Built on: Thu Dec 5 14:26:01 UTC 2024
    • 6
    • Team Hedgehog 2024 Review 4, Team Hedgehog 2024 Sprint 4.1, Team Hedgehog 2024 Sprint 4.2, Team Hedgehog 2024 Sprint 4.3, Team Hedgehog 2025 Sprint 1.0

      Reported by sarjona while testing MDLQA-19229.

      Going through the testing instructions, on step 11 as a teacher it's not possible to open a file added by a student linked to a MS OneDrive repository using 'Create an access controlled link to the file'. Instead the following error is displayed:

      Probably something has changed on the Microsoft side and we might need to change it in our API as well.

      Noting that Sara also managed to reproduce the problem on 4.4.0 as well - even though she tested that last QA cycle and the test passed.

            huongn@moodle.com Huong Nguyen
            lameze Simey Lameze
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 1 hour, 48 minutes
                4d 1h 48m

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