Revoke user role from the current user session

Neha42
Tera Contributor

Hi Everyone,

 

I have one requirement once user has completed to run the atf test case then 'impersonator' role should be revoked from the user's current session.

Providing the impersonator role in current session is working fine but I'm not able to revoke 'impersonator' role from  user current session.

If anyone has implemented the similar functionality then please let me know.

 

Thanks

3 REPLIES 3

Som4
Tera Contributor

You can add server test step to update the user record by remove the impersonate role for above user.

J Siva
Tera Sage

Hi @Neha42 

As a best practice, a new user account should be created within the ATF tests, and the impersonator role should be granted through a test step.

This ensures that all activities performed during the test run are reverted without any negative impact.

Regards,

Siva

Neha42
Tera Contributor

Hi @J Siva 

 

Thanks for the reply.

Here, the requirement is: The Actual user, who is running the test case should not have impersonator role so we have removed Impersonator role from ATF Test Designer Role( contains Impersonator role).

In test step, impersonate will work only when actual user will have impersonator role.

 

While at starting to run the test case, we are granting the impersonator role to the Actual user in current session but after successful run of the test cases, I need to revoke Impersonator role from the actual user.

 

Revoking impersonator role from actual user in current session is not working and we cannot grant impersonator role to the user.

 

Thanks