Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change GradebookService to find an active user properly
closes INTEROP-6110 flag=none Change GradebookService to find the active user when the specified was merged. When user A is merged to user B, the name and roles API (api/lti/courses/:course_id/names_and_roles) returns the user B (active) with the lti_id of user A. Using this lti_id, and attempting to grade a line item using the score api (api/lti/courses/:course_id/line_items/:line_item_id/scores), an unauthorization error is raised. If the user is deleted we need to check to see if there has been a user_merge. If there has been a merge, return the merged user, otherwise we return `nil`, so we'll not not return the deleted user anymore. test plan: * In Course context, we need to have two users with Student enrollment; * Accessing the name and roles API, we will see the two active members with their lti_id; * Merge one user in the other one (User A -> User B); * Accessing the name and roles API, we will see the user B active with the lti_id from user A; * If the course doesn't have line items, we can use the line items endpoint (api/lti/courses/:course_id/line_items) to create one; * Accessing the scores API using the user A lti_id, the response of the request should be successful instead of unauthorized (as is happening today); Change-Id: I3d23b9ce96c725b91e920e73705ba952140090fb Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255789 Tested-by: Service Cloud Jenkins <[email protected]> Reviewed-by: Mysti Lilla <[email protected]> QA-Review: Mysti Lilla <[email protected]> Product-Review: Wagner Goncalves <[email protected]>
- Loading branch information