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

Portfolio "export whole discussion" button should not be visible if the user has inadequate permissions

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup

      1. Login as admin
      2. Search and enable setting enableportfolios.
      3. Go to Site administration > Plugins > Portfolios > Manage portfolios
      4. Set File download field to Enabled and visible.
      5. You need a course with a student and a teacher enrolled.

      Testing

      1. Login as as teacher
      2. Add a forum to the course
      3. Create a new topic
      4. Open this topic and click on the button "Export whole discussion to portfolio"
      5. See that a new export page is showed
      6. Login as student
      7. Go to the Forum and to the topic.
      8. Make sure that the "Export whole discussion to portfolio" is not visible.
      Show
      Setup Login as admin Search and enable setting enableportfolios . Go to Site administration > Plugins > Portfolios > Manage portfolios Set File download field to Enabled and visible . You need a course with a student and a teacher enrolled. Testing Login as as teacher Add a forum to the course Create a new topic Open this topic and click on the button "Export whole discussion to portfolio" See that a new export page is showed Login as student Go to the Forum and to the topic. Make sure that the "Export whole discussion to portfolio" is not visible.
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
    • Pull 3.9 Branch:
    • Pull Master Branch:
      MDL-66818-master

      Description

      When portfolios are enabled on the forum, there is a button to "Export whole discussion to portfolio". If the user is a student with default permissions, clicking on this button will result in the following being displayed:

      Sorry but you do not have the required permissions to export files from this area
      

      Really this button should not be visible if the user does not have adequate permissions.

      Edit by Kathrin Osswald:
      Steps to reproduce

      Prerequisites: Course with teacher T and student S enrolled.

      1. Login as admin
      2. Enable setting enableportfolios
      3. Go to Site administration > Plugins > Portfolios > Manage portfolios and set the value for the portfolio plugin File download to Enabled and visible
      4. Logout
      5. Login as as teacher T
      6. Go to the course, turn editing mode on and add a forum to the course
      7. Create a new topic
      8. Open this topic and click on the button "Export whole discussion to portfolio"
      9. See that a new export page is showed
      10. Logout
      11. Login as student S
      12. Go to the course
      13. Open the forum
      14. Open the topic
      15. Click on the button "Export whole discussion to portfolio"
      16. Then you should see the error message "Sorry but you do not have the required permissions to export files from this area"

      Error Message

      Debug info: Error code: nopermissions
      Stack trace: line 188 of /portfolio/add.php: portfolio_caller_exception thrown
      

      Expected Behavior
      The button should not be visible to users without the capability mod/forum:exportdiscussion

        Attachments

          Activity

            People

            Assignee:
            brudinie guy thomas
            Reporter:
            abgreeve Adrian Greeve
            Peer reviewer:
            Simey Lameze
            Integrator:
            Andrew Nicols
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Sep/20

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 42 minutes
                4h 42m