How could I find out the role name - Sonatype Nexus Repository - Sonatype Community
How could I find out the role name
post by ashang on Aug 18, 2025
AiJun Shang
Hey Team,
How could I find out the role name by repository name? Or how could I get the username by the role name?
Thanks a lot
63 views
post by joris.klop on Aug 25, 2025
Joris Klop
Innovator
Hi AiJun,
The roles are just refer to permissions, so if you want to know what roles provide access to what repo you currently can only write a fancy Python script.
The GUI does not have this functionality (repo>role(s) or lists users all member of role example_role). Be aware that anonymous role can also provide some level of access, e.g. read access, and that can sometimes be “a suprise”. Also be aware that if you use group-repositories, the privileges of underlying repositories are not used, only privileges/roles on the specific group provide direct access to all child repositories inside the group. Example, group-repo-a has a member repo-b, repo-c and repo-d: In this example only privileges related to group-repo-a directly provide access to repo-b, repo-c and repo-d, there is no requirement (or use case) to use the privileges for repo-b, repo-c and repo-d except for the fact you want to upload files to them, in that case you are not using a group rep.
So to summarize: Good question, but this functionality you need to code yourself. All is available by API, so it would not be really complicated. Note there is a certain margin of error, if you make a mistake in your code the results can be wrong.
Regards, Joris