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

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.9
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:
      None
    • Testing Instructions:
      • 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
    • Workaround:
      Hide

      Make the webservice user a site admin

      Show
      Make the webservice user a site admin
    • Affected Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

              Assignee:
              Unassigned Unassigned
              Reporter:
              danielneis Daniel Neis Araujo
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: