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

Custom user field support: Admin role screens (check permissions, assign)

XMLWordPrintable

    • MOODLE_311_STABLE
    • MOODLE_400_STABLE
    • MDL-71466-master
    • Hide

      Note: This is a similar test script to the Behat tests included in the issue, but running through it manually could spot any unusual problems (or not).

      1. If you don't already have one, add a custom user field on your site with 'Text input' type and a maximum length of e.g. 100 characters. You can call it anything you want, but for example 'Lucky number'.
      2. Go to Site administration / Users / Permissions / User policies.
      3. In the Show user identity setting, tick your custom field.
      4. Find two existing test accounts (or add two new user accounts). Edit the profile and change the custom field (lucky number) to Seven for one account and Forty-two for the other. (Spelling the values out in words just reduces the chance they will clash with other data in your test accounts, if you have a lot of accounts on the server. You could use other values instead if you prefer.)
      5. Go to any course and enrol the test account with number Seven.
      6. Back on the course page, in the course admin menu, go to More / Users / Permissions / Check permissions.
      7. Type Seven in the search box.
        • EXPECTED: The user with lucky number Seven should appear in the search results, under heading 'Matching enrolled users (1)'.
        • EXPECTED: The entry for that user should display the selected identity fields after the user's name, including Seven.
      8. Type Forty-two in the search box.
        • EXPECTED: The user with lucky number Forty-two should appear in the search results, under heading 'Potential users matching Forty-two'.
      9. Select the user and click the button to check permissions for the user.
        • EXPECTED: You should reach the check permissions page for that user with no errors.
      10. Leave the check permissions area and go to any activity in the course.
      11. In the activity admin menu, select Locally assigned roles.
      12. Select any role.
      13. Type Seven in the right-hand search box.
        • EXPECTED: The user with lucky number Seven should appear in the search results.
        • EXPECTED: The entry for that user should display the selected identity fields after the user's name, including Seven.
      14. Select and add the user
        • EXPECTED: They should move into the existing users box.
      15. Type Seven in the left-hand search box.
        • EXPECTED: The user with lucky number Seven should still appear on the left.
      16. Select and click the button to remove the user
        • EXPECTED: The user should be removed from the left-hand box.
      Show
      Note: This is a similar test script to the Behat tests included in the issue, but running through it manually could spot any unusual problems (or not). If you don't already have one, add a custom user field on your site with 'Text input' type and a maximum length of e.g. 100 characters. You can call it anything you want, but for example 'Lucky number'. Go to Site administration / Users / Permissions / User policies . In the Show user identity setting, tick your custom field. Find two existing test accounts (or add two new user accounts). Edit the profile and change the custom field (lucky number) to Seven for one account and Forty-two for the other. (Spelling the values out in words just reduces the chance they will clash with other data in your test accounts, if you have a lot of accounts on the server. You could use other values instead if you prefer.) Go to any course and enrol the test account with number Seven. Back on the course page, in the course admin menu, go to More / Users / Permissions / Check permissions . Type Seven in the search box. EXPECTED: The user with lucky number Seven should appear in the search results, under heading 'Matching enrolled users (1)'. EXPECTED: The entry for that user should display the selected identity fields after the user's name, including Seven. Type Forty-two in the search box. EXPECTED: The user with lucky number Forty-two should appear in the search results, under heading 'Potential users matching Forty-two'. Select the user and click the button to check permissions for the user. EXPECTED: You should reach the check permissions page for that user with no errors. Leave the check permissions area and go to any activity in the course. In the activity admin menu, select Locally assigned roles . Select any role. Type Seven in the right-hand search box. EXPECTED: The user with lucky number Seven should appear in the search results. EXPECTED: The entry for that user should display the selected identity fields after the user's name, including Seven. Select and add the user EXPECTED: They should move into the existing users box. Type Seven in the left-hand search box. EXPECTED: The user with lucky number Seven should still appear on the left. Select and click the button to remove the user EXPECTED: The user should be removed from the left-hand box.

      The 'Check permissions' screen needs updating to support custom user fields. The screen is admin/roles/check.php, e.g.:

      https://sandbox.moodledemo.net/admin/roles/check.php?contextid=18

      Custom user field support is important on this screen for searching for users, and selecting users, in cases where a custom field is being used as an identifier.

      In the same area, the 'Assign roles' screen also needs updating. This is admin/roles/assign.php. It is used for assigning users to system-level roles and roles within an activity module (everything other than on roles a course, which is usually done with a different GUI).

      Note: This improvement was developed after the 3.11 code freeze so it is intended for Moodle 3.12.

            quen Sam Marshall
            quen Sam Marshall
            Katie Ransom Katie Ransom
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 35 minutes
                1h 35m

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