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

user_get_user_details returns username only to current user or site admin

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • 2.9
    • Web Services
    • None
    • MOODLE_29_STABLE
    • Hide

      Make the webservice user a site admin

      Show
      Make the webservice user a site admin
      • Call get_enrolled_users webservice with a user that is not siteadmin, asking for username, and see that username is not returned.
      • Apply the patch, call the webservice again and see the username field is returned

    Description

      A restriction was added to user_get_user_details
      during the development of MDL-27976 ,
      that makes it return the username only if the user requesting
      is a siteadmin or if the user requesting is the same as the user requested.
      As this function is used by the webservices such as
      get_enrolled_users_with_capability and get_enrolled_users,
      it is at leat annoying.

      The workaround is to made the webservice user a site admin.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              danielneis Daniel Neis Araujo
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: