Unfortunately, this is a bit of a tricky situation for which there is to my knowledge no elegant solution. This is a common question as you can see in the following topics/solutions:
Specific to adding permissions via a Rule:
And Action:
The primary reason this isn’t really a viable solution is that Management API limits are rather low.
This could be a good candidate for a feedback request as I’m not seeing anything related to this after some quick searching.
Hope this helps at least to give you a better idea of what this looks like currently!