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

File picker drag/drop checks repository/upload:view at site context

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Revoke capability to use repository "upload" from authenticated user
      2. As a teacher go to the course page, turn editing on, make sure "Drag and drop files" message does not appear on top of the page
      3. Edit course settings (or add a module), make sure the "Drag files here" message does not appear inside filemanager
      4. As admin add capability to use repository "upload" to the "editingteacher" role
      5. As a teacher go to the course page, turn editing on, make sure "Drag and drop files" message DOES appear on top of the page
      6. Add some activity and upload files into it.
      7. As the same teacher drag and drop the file into the filemanager and into the filepicker (for example filemanager in folder module and filepicker in file field in database module).
      8. Make sure teacher can do both things
      Show
      Revoke capability to use repository "upload" from authenticated user As a teacher go to the course page, turn editing on, make sure "Drag and drop files" message does not appear on top of the page Edit course settings (or add a module), make sure the "Drag files here" message does not appear inside filemanager As admin add capability to use repository "upload" to the "editingteacher" role As a teacher go to the course page, turn editing on, make sure "Drag and drop files" message DOES appear on top of the page Add some activity and upload files into it. As the same teacher drag and drop the file into the filemanager and into the filepicker (for example filemanager in folder module and filepicker in file field in database module). Make sure teacher can do both things
    • Workaround:
      Hide

      The only workaround is to assign the repository/upload:view capability at site level. (With default Moodle roles this happens anyway, because authorised user has this capability.)

      Show
      The only workaround is to assign the repository/upload:view capability at site level. (With default Moodle roles this happens anyway, because authorised user has this capability.)
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      wip-MDL-46834-master

      Description

      Moodle file picker drag and drop checks repository/upload:view capability at the site context, even when the file picker is in a course context.

      This is not consistent with the behaviour when adding files using the '+' button and choosing to upload a file, which correctly uses the course context.

      To reproduce this issue:

      1. Edit the 'authenticated user' role and turn off repository/upload:view.
      2. Edit the 'teacher' role and turn on repository/upload:view.
      3. Create a new course.
      4. Enrol a test account on the course with teacher role.
      5. Log in as the test account and go to the course.
      6. Click 'Add activity or resource' and choose 'File'.
      7. Drag a file from your desktop into the filepicker area.

      EXPECTED: File should upload.
      ACTUAL: JavaScript error popup 'No permission to access this repository.'

      In the same position, if you click the '+' button and choose 'Upload a file' then browse to the same file, you will be able to upload it successfully.

      Slightly similar to MDL-36200 but probably not related.

        Attachments

          Activity

            People

            Assignee:
            marina Marina Glancy
            Reporter:
            quen Sam Marshall
            Peer reviewer:
            Frédéric Massart Frédéric Massart
            Integrator:
            Dan Poltawski Dan Poltawski
            Tester:
            John Okely John Okely
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14