Is there anyway in DW API to add a group to the impressonate list of an user ?
Best,
Rui Silva
Is there anyway in DW API to add a group to the impressonate list of an user ?
Best,
Rui Silva
Hi Rui,
It is possible, but you can't do it on the basis of the Group by itself, you need the users in the group.
Something like this:
// Get your user that can impersonate var userThatCanImpersonate = User.GetUserByID(100); // Get your group that can be impersonated var groupThatCanBeImpersonated = Group.GetGroupByID(100); // Get the ids of the users that can be impersonated var idsOfUsersThatCanBeImpersonated = groupThatCanBeImpersonated.Users.Select(user => user.ID).ToList(); // Set the list of user ids on the current user and mark the relation so that the userThatCanImpersonate object is the one that can impersonate userThatCanImpersonate.UpdateSecondaryUsers(idsOfUsersThatCanBeImpersonated, updateUsersICanSetAsSecondary: true)
Be aware that this will replace any existing impersonation relations. If you want to keep those, then they need to be added to the list of ids.
- Jeppe
Thanks for the help.
You must be logged in to post in the forum