we are limiting no. of entitlements by customizing OOTB LCM workflow. You can add a step , this step will read the plan and if plan has more than 20 adds , you can prompt an error to the user. however, user will need to submit request again with less no of entitlements. Apart from this I don’t think there is a way to limit the no. of adds in the access request.
You can modify LCM workflow. Add a new step before step initialize step in LCM. in this new step read the plan. now you can check how many “add” are there in the plan. if your condition meets then move to error step else continue. in the error step you can display why this request cannot be submitted as user requested more than 20 entitlements.
for eg.
This would definitely work.
However please take into consideration that there was already effort for the requester to sample together the request.
If now the request just fails the user experience may be negatively impacted.
That’s the reason why we use Policies to achieve the goal and that works really well.
basically the idea is to compare the persisted identity with the version passed into the policy check (policy rule).
If you compare the values
identity.getAssignedRoles().size()
with the persisted identity you should be able to retrieve the number of roles requested.
Based on the comparison you may want to create a Policy Violation.
Unfortunately I do not have access to the environment where we already made some tests but please have a look into the following post on Compass: