Desire2Learn Valence: Unenrolling users with hidden roles

211 views Asked by At

I'm having an issue with the unenroll call in Valence API for the users with roles that are hidden. I can unenroll the users with visible roles though.

My organization's wiki says that "If users are missing from the Classlist, their role in the course may be hidden". Is there any way to unenroll such a user? Am I missing some permissions to unenroll these users with hidden roles?

1

There are 1 answers

3
Viktor Haag On BEST ANSWER

In order to delete a user enrollment using DELETE /d2l/api/lp/(version)/enrollments/orgUnits/(orgUnitId)/users/(userId) (or the action that removes the enrollment by specifying user ID first and then org unit ID), the calling user context must have permission to:

  • See user enrollments in the first place (Users>View User Enrollments), at the organization level

  • Search for the user role type(Users>Search for RoleType), at the organization level

  • Enroll the user role type (Users>Enroll RoleType), at the organization level

Since the various enrollments actions are considered administrator-type actions, they use the "Users" role permissions at the organization level.

D2L has not currently provided classlist level API actions to unenroll users (so user contexts that would be able to un-enroll users from the classlist tool, within the web UI, often cannot do so using the Learning Framework API, unless the calling user's role has the organization-level permissions required to unenroll users).