Xorigin membership from Business Role

hello,

the customer gave me this problem to solve.

So, I have to manage the removal of memberships from Business Role in a flat way. That is, when a person loses a business role (for whatever reason), then all of his or her inherited entitlements from the business role by assignment with xorign = 2, must switch to direct assignments, so xorigin=1. This means that practically no inherited roles must be lost for certain business roles.

Having said that, I was thinking of reasoning in advance, that is... when a person inherits for example a memebership on the adsaccount-in-adsgroup then I change the xorging from 2 to 3... so I anticipate the solution... the problem is that it requires many checks and certainly does not cover all the cases, and in any case my custom process would start for each membership..let's say not optimal..... possible that there is not something by default? or an easier solution to implement?

the complexity also lies in managing this use case for certain business roles and associations.

thank you in advance for your support.