`impersonate` fails with userAlreadyImpersonatingGroup

#1

TestApi.impersonate(ctx, 'Other_AdminGroup'); fails with the following error

{
  "id" : "1132.3008",
  "codes" : [ "NotClassified" ],
  "key" : "c3.server.member.MemberEngine_userAlreadyImpersonatingGroup",
  "template" : "User {} is already impersonating AdminGroup {}",
  "parameters" : [ "username", "DeveloperGroup" ]
}

I’ve the DeveloperGroup but I’m trying to impersonate into Other_AdminGroup (which exists) for testing!

Why this error?

0 Likes

#2

According to the error message, you are already impersonating the DeveloperGroup. Have you checked your User object? c3Grid(User.fetch())

And have you tried to unimpersonate? User.unimpersonate('myusername'))

0 Likes

#3

When I try to un-impersonate with User.unimpersonate('myusername'), I get the following error:

{
  "id" : "4709.2677",
  "codes" : [ "NotClassified" ],
  "key" : "c3.server.member.MemberEngine_userNotImpersonating",
  "template" : "User {} is not impersonating",
  "parameters" : [ "myusername" ]
}

Then same error above if I impersonate, etc…

0 Likes