Handling site permissions outside Matomo

Is there some way of handling site permissions outside of Matomo? We have an on-prem instance and have our internal controls for permissioning but there doesn’t seem to be any way to integrate that with the Matomo instance other than making changes to the source code which would make the process of updates complicated if not impossible.

You can do it through:
https://developer.matomo.org/api-reference/reporting-api#UsersManager