List of repos (via API) an other user has access to #6639

Closed
opened 2025-11-02 07:02:10 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @jk-nilo on GitHub (Jan 5, 2021).

Description

I'm a global admin on my installation of Gitea and I need to generate a report of permissions by API for a specific user.

However, the API method users/{username}/repos does not list user's repositories where the user has access to, even with my token. It returns HTTP 200 with empty JSON array []. My guess is that the user is collaborator or team member in repositories, not their owner, and this method ignores it. However, there is no other way how to retrieve such info.

Above try.gitea.io URL does not list my repository (https://try.gitea.io/jk-nilo/PerformanceApi) to which I give the user a write access.

Thank you

Screenshots

Originally created by @jk-nilo on GitHub (Jan 5, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.13.1 - Git version: not relevant - Operating system: Windows 2008 R2 <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL): https://try.gitea.io/api/v1/users/111aaaqqq/repos - [ ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description I'm a global admin on my installation of Gitea and I need to generate a report of permissions by API for a specific user. However, the API method `users/{username}/repos` does not list user's repositories where the user has access to, even with my token. It returns HTTP 200 with empty JSON array `[]`. My guess is that the user is collaborator or team member in repositories, not their owner, and this method ignores it. However, there is no other way how to retrieve such info. Above try.gitea.io URL does not list my repository (https://try.gitea.io/jk-nilo/PerformanceApi) to which I give the user a write access. Thank you ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@6543 commented on GitHub (Jan 5, 2021):

users/{username}/repos only list the repos a user own ...

@jk-nilo a working solution would be the https://try.gitea.io/api/swagger#/user/userCurrentListRepos with sudo header
this is a privacy feature ... ☝️ only admins can use sudo header ;)

@6543 commented on GitHub (Jan 5, 2021): `users/{username}/repos` only list the repos a user own ... @jk-nilo a working solution would be the https://try.gitea.io/api/swagger#/user/userCurrentListRepos with sudo header this is a privacy feature ... :point_up: only admins can use sudo header ;)
Author
Owner

@jk-nilo commented on GitHub (Jan 5, 2021):

Thanks for pointing out about the "sudo header" what is it for :)

For others, in docs, https://docs.gitea.io/en-us/api-usage/#sudo

@jk-nilo commented on GitHub (Jan 5, 2021): Thanks for pointing out about the "sudo header" what is it for :) For others, in docs, https://docs.gitea.io/en-us/api-usage/#sudo
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6639