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

Bulk delete cohort - Confusing Button

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5
    • Cohorts
    • MOODLE_405_STABLE
    • MDL-84745-405
    • MDL-84745-500
    • Hide

      Setup

      1. Log in as admin
      2. Create a new user
      3. Navigate to Users > Permissions > Define roles in site administration
      4. Edit the Authenticated user role
        • Allow the moodle/cohort:view capability
        • Allow the moodle/site:configview capability
      5. Edit the Manager role:
        • Remove the moodle/cohort:manage capability
      6. Navigate to Courses > Manage courses and categories in site administration
      7. Assign your test user the Manager role in Category 1
      8. Navigate to Users > Accounts > Cohorts in site administration
      9. Create a new cohort:
        • Name: Cohort 1
        • Context: System
      10. Create another new cohort:
        • Name: Cohort 2
        • Context: Category 1
      11. Log out

      Test

      1. Log in as test user
      2. Navigate to Users > Accounts > Cohorts in site administration
      3. Confirm the user cannot see Delete selected under System cohorts
      4. Press All cohorts
      5. Confirm the user cannot see Delete selected under All cohorts
      6. Press on the link to Category 1 context
      7. Confirm the user cannot see Delete selected under Category 1
      8. Log out
      9. Log in as admin
      10. Navigate to Users > Permissions > Define roles in site administration
      11. Edit the Manager role:
        • Allow the moodle/cohort:manage capability
      12. Log out
      13. Log in as test user
      14. Navigate to Users > Accounts > Cohorts in site administration
      15. Confirm the user cannot see Delete selected under System cohorts
      16. Press All cohorts
      17. Confirm the user can see Delete selected under All cohorts
      18. Press on the link to Category 1 context
      19. Confirm the user can see Delete selected under Category 1
      Show
      Setup Log in as admin Create a new user Navigate to Users > Permissions > Define roles in site administration Edit the Authenticated user role Allow the moodle/cohort:view capability Allow the moodle/site:configview capability Edit the Manager role: Remove the moodle/cohort:manage capability Navigate to Courses > Manage courses and categories in site administration Assign your test user the Manager role in Category 1 Navigate to Users > Accounts > Cohorts in site administration Create a new cohort: Name: Cohort 1 Context: System Create another new cohort: Name: Cohort 2 Context: Category 1 Log out Test Log in as test user Navigate to Users > Accounts > Cohorts in site administration Confirm the user cannot see Delete selected under System cohorts Press All cohorts Confirm the user cannot see Delete selected under All cohorts Press on the link to Category 1 context Confirm the user cannot see Delete selected under Category 1 Log out Log in as admin Navigate to Users > Permissions > Define roles in site administration Edit the Manager role: Allow the moodle/cohort:manage capability Log out Log in as test user Navigate to Users > Accounts > Cohorts in site administration Confirm the user cannot see Delete selected under System cohorts Press All cohorts Confirm the user can see Delete selected under All cohorts Press on the link to Category 1 context Confirm the user can see Delete selected under Category 1
    • Hide

      Code verified against automated checks.

      Checked MDL-84745 using repository: https://github.com/paulholden/moodle.git

      More information about this report

      Built on: Mon Jun 9 08:41:39 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84745 using repository: https://github.com/paulholden/moodle.git MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-84745-405 | CI Job ] MOODLE_500_STABLE (0 errors / 0 warnings) [branch: MDL-84745-500 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-84745 | CI Job ] More information about this report Built on: Mon Jun 9 08:41:39 UTC 2025

      Following the addition of the bulk deletion of cohorts in 4.5, we noticed that the “Delete Selected” button in the Cohorts page is displayed for certain roles who don't have bulk deletion rights, even though the checkbox on each cohort row is not visible. 

      Upon hovering, the button changes colour and a selecting hand appears.

      This may be seen as a malfunction for users who don't have bulk deletion permission, as it makes it look like they could use this functionality but it's not working.

      In the backend, there is no permission check on visibility of the ‘Delete selected’ button, whereas the checkboxes do have a permission check on them.

      Is there scope to change the code so that permissions can define whether a user can or cannot see the button (or at least can see it in a greyed out/unactionable state)?

      Delete selected Cohorts button.mp4

            pholden Paul Holden
            Natacha_V Natacha Vaisset
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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