As per the original post.
We also built a SQL query for this, but does anyone have this as a QML file to import?
Here is some starting point. It lists the roles and users assigned, Problem is for group2role assignments. Then you will need to loop through the groups to get down to the principal. Therefore you might need a custom class to report this correctly.