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

Report condition to limit returned data to current user

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.0
    • Report builder
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide

      Setup

      1. Log in as admin
      2. Create two new users (user01, user02)
      3. Create two new cohorts (cohort01, cohort02)
      4. Add user01 to cohort01
      5. Add user02 to cohort02
      6. Navigate to Users > Permissions > Define roles in site administration
      7. Edit Authenticated user role
      8. Allow the moodle/site:configview capability

      Create report

      1. Navigate to Reports > Report builder > Custom reports in site administration
      2. Create a new report using the Cohorts report source
      3. Open Settings > Conditions in report editor
      4. Add the Users > Select user condition
      5. Change Any user to Current user and press Apply
      6. Confirm report now shows Nothing to display (because your account isn't in any cohorts)
      7. Press the Audience tab
      8. Add the All users audience type

      Test as user01

      1. Log in as user01
      2. Navigate to Reports > Report builder > Custom reports in site administration
      3. Click on name of custom report to view it
      4. Confirm you only see report data on cohort01

      Test as user02

      1. Log in as user02
      2. Navigate to Reports > Report builder > Custom reports in site administration
      3. Click on name of custom report to view it
      4. Confirm you only see report data on cohort02
      Show
      Setup Log in as admin Create two new users (user01, user02) Create two new cohorts (cohort01, cohort02) Add user01 to cohort01 Add user02 to cohort02 Navigate to Users > Permissions > Define roles in site administration Edit Authenticated user role Allow the moodle/site:configview capability Create report Navigate to Reports > Report builder > Custom reports in site administration Create a new report using the Cohorts report source Open Settings > Conditions in report editor Add the Users > Select user condition Change Any user to Current user and press Apply Confirm report now shows Nothing to display (because your account isn't in any cohorts) Press the Audience tab Add the All users audience type Test as user01 Log in as user01 Navigate to Reports > Report builder > Custom reports in site administration Click on name of custom report to view it Confirm you only see report data on cohort01 Test as user02 Log in as user02 Navigate to Reports > Report builder > Custom reports in site administration Click on name of custom report to view it Confirm you only see report data on cohort02

    Description

      As a report creator

      I want to create reports that are customised to each user

      So that each user gets personalised reports related to themselves

      Attachments

        Activity

          People

            pholden Paul Holden
            pholden Paul Holden
            Mikel Martín Corrales Mikel Martín Corrales
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            David Carrillo, Paul Holden
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              19/Apr/22

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 35 minutes
                3h 35m