Hi Ahmad,
I am not sure if there is any tool which you can use to remove the specific privileges. As mentioned above, it would be quicker to remove the permissions manually (provided you don't have many roles). If you still want to automate then you can run the below code script on 'Code Now' tool to remove account delete & case delete privledges.
I have tried this and it seems working fine but it is always a good idea to test the script in sandbox/ test environment instead of directly rtying it against product. I have commented the main service.execute so that you don't run this by mistake.
======================
public static void CodeNow(){
var fetchXml = @"<fetch version='1.0' mapping='logical' distinct='false'>
<entity name='roleprivileges'>
<attribute name='privilegeid'/>
<attribute name='roleid'/>
<link-entity name='role' alias='roles' to='roleid' from='roleid' link-type='inner'>
<attribute name='name'/>
<filter type='and'>
<condition attribute='name' operator='neq' value='System Administrator' />
</filter>
</link-entity>
<link-entity name='privilege' alias='privileges' to='privilegeid' from='privilegeid' link-type='inner'>
<attribute name='name'/>
<filter type='or'>
<condition attribute='name' operator='eq' value='prvDeleteAccount' />
<condition attribute='name' operator='eq' value='prvDeleteIncident' />
</filter>
</link-entity>
</entity>
</fetch>";
var allRecordss = Service.RetrieveMultiple(new FetchExpression(fetchXml));
foreach (var record in allRecordss.Entities)
{
RemovePrivilegeRoleRequest removePrivilageRequest = new RemovePrivilegeRoleRequest()
{
PrivilegeId = new Guid(record["privilegeid"].ToString()),
RoleId = new Guid(record["roleid"].ToString())
};
//Service.Execute(removePrivilageRequest);
LogMessage(string.Format("Removed '{0}' privilege from '{1}' role.", ((AliasedValue)record["privileges.name"]).Value.ToString(), ((AliasedValue)record["roles.name"]).Value.ToString()));
}
}
=============
www.itaintboring.com/.../code-now-plugin-for-xrmtoolbox
www.itaintboring.com/.../lets-use-xrmtoolbox-to-run-some-c-code-into-dynamics
Hope this help.