Issue in target instance

Sarah Bouil
Tera Expert

Hi,

 

In production, the role 'u_aqcc_read' is having 3 members like: A,B,C, so they can have access ready only. In test, the same users A,B,C is having access to edit or write.

 

So when we clone from prod to test the role 'u_aqcc_read' is adding to users A,B,C in test, hence they are loosing the edit or write access.

 

So I want to clean the role 'u_aqcc_read' from users in test by using Cleanup scripts after post clone. How to do that?

7 REPLIES 7

If the group has multiple roles a better approach might be to remove the role from the group.
sys_group_has_role, maybe something like this

var grm = new GlideRecord('sys_group_has_role');
grm.addQuery('group', 'group_sys_id');
grm.addQuery('role', 'role_sys_id');
grm.query();
if(grm.next()) {
grm.deleteRecord();
}



Also, I should not touch users who is having the read only role. only identify the users to whome the ready only role added during cloning and delete those users only, not all the users.

Mark Manders
Mega Patron

Why not use data preservers and table excludes? If you exclude your sys_user_has_role, sys_group_has_role, sys_user_grmember tables and preserve the data, you won't have any issues (assuming your users have the same sys_id's on the instances).


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark