Issue in target instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 06:55 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 01:58 PM
Hi, exactly what you need to do will depend on whether the role is applied directly or via group membership.
If via a group then a glidequery on sys_user_grmember for the group and\or role
Then delete the results.
if via direct relationship to sys_user, a glidequery on sys_user_has_role for the role
Then delete the results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 02:31 PM
var grm= new GlideRecord('sys_user_grmember');
grmaddQuery('group=3c679568db0ba8d0123dee0c4567890c^ORgroup=987f2a234ff3d23456ca3d828110c945');//group sys_id's
grmquery();
if(grmnext())
{
//grmdeleteRecord();
}
The above code is fine? or need to add any additional code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 04:28 PM - edited 05-22-2024 04:30 PM
Hi, small syntax error and also you are using an encoded query so
grm.addEncodedQuery('group=3c679568db0ba8d0123dee0c4567890c^ORgroup=987f2a234ff3d23456ca3d828110c945');//group sys_id's
But as per other post, I would look ats deleting the role from the group.
Edit, also missing . s
grm.query();
if(grm.next())
{
//grm.deleteRecord();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 02:40 PM
The read only role might be added to user from group also. So I have to identify the users and need to delete the read only role from that user in target instance.