Impersonating user without console access

#1

If I impersonate someone without console access, how do I unimpersonate if I don’t have access to the console?

0 Likes

#2

You can use CURL to send the request to the server. Something like curl 'https://<VANITY_URL>/api/1/User?action=unimpersonate&auth=b' -U IMPERSONATOR-ID -H 'Content-type: application/json' -H 'Accept: application/json' --data-binary '{"impersonator":"<IMPERSONATOR-ID>"}' you will be prompted for the password.

0 Likes

#3

When you impersonate a user you should also be given the C3.Group.Impersonator which has the role C3.Role.Impersonator. Using c3Grid(Role.seed()) we can see the following permissions:

[
  {
    "type": "Permission",
    "access": "allow",
    "typeName": "*",
    "actionGroup": "user-impersonator"
  },
  {
    "type": "Permission",
    "access": "allow",
    "typeName": "Console",
    "action": "*"
  },
  {
    "type": "Permission",
    "access": "allow",
    "typeName": "User",
    "action": "merge"
  }
]

Unless I’m misunderstanding the permissions that Role should give you console access and the ability to unimpersonate the user

0 Likes

#4

Once you impersonate, you no longer have that Role, you only have the Roles of the impersonatee.
Unless, of course, the impersonatee has the Role, or the explicit permissions.

0 Likes

#5

Or use Python from a jupyter notebook (assuming you have access to that) :wink:

0 Likes