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

Teachers cannot access Server files (No permission to access)

    Details

    • Testing Instructions:
      Hide

      Test pre-requisites

      1. Create a 1.9 and add some course files
      2. Use the 1.9 instance and upgrade it to 2.2, then to 2.3, 2.4 and master to test each version against it.
      3. Enable Server files repository

      Test steps

      1. Login as a teacher
      2. Add a folder to a course and add files:
        • Make sure you can browse the Server files repository
        • Make sure you can browse the Course files repository (legacy from 1.9)
        • Make sure any other repository does not throw the error 'No permission to access'

      Test 2

      1. Repeat MDL-36426 testing instructions (I'm sorry!)

      Test 3

      1. Repeat MDL-37852 testing instructions (I'm very sorry!)
      Show
      Test pre-requisites Create a 1.9 and add some course files Use the 1.9 instance and upgrade it to 2.2, then to 2.3, 2.4 and master to test each version against it. Enable Server files repository Test steps Login as a teacher Add a folder to a course and add files: Make sure you can browse the Server files repository Make sure you can browse the Course files repository (legacy from 1.9) Make sure any other repository does not throw the error 'No permission to access' Test 2 Repeat MDL-36426 testing instructions (I'm sorry!) Test 3 Repeat MDL-37852 testing instructions (I'm very sorry!)
    • Workaround:
      Hide
      1. Navigate to Home ► Site administration ► Users ► Permissions ► Define roles
      2. Create a new role
        • Call it Server files
        • Allow the capability repository/local:view
      3. Navigate to Home ► Site administration ► Users ► Permissions ► Assign system roles
      4. Select Server files
      5. Add the users who are teachers in some courses in this list
      Show
      Navigate to Home ► Site administration ► Users ► Permissions ► Define roles Create a new role Call it Server files Allow the capability repository/local:view Navigate to Home ► Site administration ► Users ► Permissions ► Assign system roles Select Server files Add the users who are teachers in some courses in this list
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38474-master

      Description

      Teachers (or any other role on a course context), are not able to browse the Server files repository. Error message: "No permission to access this repository"

      This is a regression created by MDL-36426 when the security of the repositories have been enhanced.

      The problem here being that the Server files repository (repository/local) is defined on a system context, but browse course files. So the logic checks that the user has the capability on a system context, who doesn't (cannot be a teacher on a system level).

      A workaround is to create a new role, with the only capability repository/local:view set to allowed, and give that role to teachers but on a system level.

      This could apply to coursefiles too

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  6 Vote for this issue
                  Watchers:
                  14 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    18/Mar/13