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

Prevent admins to add deprecated WS functions to web services

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.9
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide

      BEFORE PULLING LATEST INTEGRATION

      1. Set web services
        1. Create a service adding all functions to it
        2. Generate a token to admin (he/she should be able to run all functions)

      List of deprecated ws functions

      • moodle_course_create_courses
      • moodle_course_get_courses
      • moodle_enrol_get_enrolled_users
      • moodle_enrol_get_users_courses
      • moodle_enrol_manual_enrol_users
      • moodle_file_get_files
      • moodle_file_upload
      • moodle_group_add_groupmembers
      • moodle_group_create_groups
      • moodle_group_delete_groupmembers
      • moodle_group_delete_groups
      • moodle_group_get_course_groups
      • moodle_group_get_groupmembers
      • moodle_group_get_groups
      • moodle_message_send_instantmessages
      • moodle_notes_create_notes
      • moodle_role_assign
      • moodle_role_unassign
      • moodle_user_create_users
      • moodle_user_delete_users
      • moodle_user_get_course_participants_by_id
      • moodle_user_get_users_by_courseid
      • moodle_user_get_users_by_id
      • moodle_user_update_users
      • core_grade_get_definitions
      • core_user_get_users_by_id
      • moodle_webservice_get_siteinfo

      PULL LATEST INTEGRATION HERE AND UPGRADE

      • Go to Site admin -> Plugins -> WS -> External Services -> Click on the service you created before -> functions
      • You SHOULD see a debugging message stating that you are using deprecated web services
      • Click to add functions to it
      • In the functions list you SHOULD NOT see any deprecated function
      • Add a new service
      • In the functions list you SHOULD NOT see any deprecated function
      • For each of the deprecated web services of the list (sorry but we have to check that what we changed in lib/db/services.php is working as expected)
        • Call it
        • The function SHOULD work as expected
      Show
      BEFORE PULLING LATEST INTEGRATION Set web services Create a service adding all functions to it Generate a token to admin (he/she should be able to run all functions) List of deprecated ws functions moodle_course_create_courses moodle_course_get_courses moodle_enrol_get_enrolled_users moodle_enrol_get_users_courses moodle_enrol_manual_enrol_users moodle_file_get_files moodle_file_upload moodle_group_add_groupmembers moodle_group_create_groups moodle_group_delete_groupmembers moodle_group_delete_groups moodle_group_get_course_groups moodle_group_get_groupmembers moodle_group_get_groups moodle_message_send_instantmessages moodle_notes_create_notes moodle_role_assign moodle_role_unassign moodle_user_create_users moodle_user_delete_users moodle_user_get_course_participants_by_id moodle_user_get_users_by_courseid moodle_user_get_users_by_id moodle_user_update_users core_grade_get_definitions core_user_get_users_by_id moodle_webservice_get_siteinfo PULL LATEST INTEGRATION HERE AND UPGRADE Go to Site admin -> Plugins -> WS -> External Services -> Click on the service you created before -> functions You SHOULD see a debugging message stating that you are using deprecated web services Click to add functions to it In the functions list you SHOULD NOT see any deprecated function Add a new service In the functions list you SHOULD NOT see any deprecated function For each of the deprecated web services of the list (sorry but we have to check that what we changed in lib/db/services.php is working as expected) Call it The function SHOULD work as expected
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-43535_master
    • Sprint:
      BACKEND Sprint 19, Team B Sprint 1, Team Beards Sprint 2
    • Issue size:
      Medium

      Description

      I noticed that we have a lot of deprecated web services functions which were deprecated in 2.2, but not removed. I feel that web services should be deprecated in the same way as other functions but can someone confirm.

      See `git grep deprecated | grep externallib` for the list

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15