0

In the user api docs it is mentioned that to change the user's role at the organization level we need to use the schema "PUT /d2l/api/lp/(D2LVERSION: version)/users/(D2LID: userId)" This requires UpdateUserData JSON block as input, but the UpdateUserData JSON block does not have a role id in it. How, then, will we pass the new role of the user?

mdeutschmtl
  • 157
  • 6
Cadmium
  • 566
  • 3
  • 10

1 Answers1

0

Role applies to a particular level in the organization so is not an intrinsic property of a user but rather property of the relationship between a user and the org or user and the org unit (department, course etc).

So you could delete and then create the user’s enrollment at the org level . (Id for the org level is retrieved with org info call )

The operation to delete the enrollment is on the enrollment page. And the operation to create the enrollment is on the same page.

However, it is NOT typical for a user to have no enrollment at the org level (e.g. if there was a connection interrupt between delete and create it is not clear what that state of not being enrolled in the org would mean)

I am not sure this fits your application, but, more typical than adding and removing enrollments at the org level is to add and remove them in a particular org level. That way the user always has a presence in the org, but, you can govern permissions via that org unit.

Cadmium
  • 566
  • 3
  • 10