User group permissions from API


#1

I’m using the RhodeCode API to generate some permission report, but I’m stuck with user groups.

I can get user groups info from ‘get_user_group’ API, but I do not have repository permissions summary information.
This API is not consistent with ‘get_user’ that returns both user info AND repository permission summary.
However this information is available on the Web UI.
It should not be difficult to add this missing item in the JSON.

OR, is there another way to get this info from the API ??


#2

Hi,

in 4.10.X there are JSON generated reports (in JSON format) for users/user groups. (see screenshot) This could allow exposing the permissions even without API access. Using whitelist controller access for example it could be exposed limiting access to this information only.

As or the API,we’ll make a ticket to make the data for get_user/get_user_group consistent. It’s the right way to do it.


#3

Indeed, I overlooked this.
I’m using the API because I have to do this for all user groups. So, manual action through GUI is prohibited.
I would really like to have it integrated in get_user_group. Thanks.


#4

Understood,

We’ll try to push this change ASAP to a release.

The webview JSON endpoint can could be exposed via the whitelist view functionality. Then it can be automated via a script.

e.g fetch all user groups via API iterate over the results and fetch the JSON report via a call to the webview that is whitelisted using the web type token.

Cheers