[Proposal] New admin API Routes #2016

Closed
opened 2025-11-02 04:21:19 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @cleverer on GitHub (Jul 6, 2018).

In order to delete a user via the API, he mustn't be part of any organisation. Right now it's not possible to get all orgs of an user. I propose a new Route GET /api/v1/admin/users/:username/orgs. The route already exists, but without the admin, so it only returns public memberships. I think, as admin you should be able to see those.

Another solution would be a listing of all orgs (GET /api/v1/admin/orgs). The user then could be tested for org membership for all orgs.

A third route which is missing for me is GET /api/v1/admin/users, which would be essential for user syncing.

Originally created by @cleverer on GitHub (Jul 6, 2018). In order to delete a user via the API, he mustn't be part of any organisation. Right now it's not possible to get all orgs of an user. I propose a new Route `GET /api/v1/admin/users/:username/orgs`. The route already exists, but without the admin, so it only returns public memberships. I think, as admin you should be able to see those. Another solution would be a listing of all orgs (`GET /api/v1/admin/orgs`). The user then could be tested for org membership for all orgs. A third route which is missing for me is `GET /api/v1/admin/users`, which would be essential for user syncing.
GiteaMirror added the type/proposalmodifies/api labels 2025-11-02 04:21:19 -06:00
Author
Owner

@shashvat-kedia commented on GitHub (Nov 27, 2018):

@lunny @cleverer Can I work on this? I am new to this project could you help me get started? Thanks

@shashvat-kedia commented on GitHub (Nov 27, 2018): @lunny @cleverer Can I work on this? I am new to this project could you help me get started? Thanks
Author
Owner

@cleverer commented on GitHub (Nov 27, 2018):

@lunny @cleverer Can I work on this? I am new to this project could you help me get started? Thanks

@sd1998 I'd love to help, but unfortunately I don't know more than you...

@cleverer commented on GitHub (Nov 27, 2018): >@lunny @cleverer Can I work on this? I am new to this project could you help me get started? Thanks @sd1998 I'd love to help, but unfortunately I don't know more than you...
Author
Owner

@lunny commented on GitHub (Nov 27, 2018):

@sd1998 You are welcome. You can find codes about GET /api/v1/users/:username/orgs as an example.

@lunny commented on GitHub (Nov 27, 2018): @sd1998 You are welcome. You can find codes about `GET /api/v1/users/:username/orgs` as an example.
Author
Owner

@shashvat-kedia commented on GitHub (Dec 2, 2018):

@lunny One doubt, so the admin should be able to fetch only the public memberships or both public and private? Thanks.

@shashvat-kedia commented on GitHub (Dec 2, 2018): @lunny One doubt, so the admin should be able to fetch only the public memberships or both public and private? Thanks.
Author
Owner

@lunny commented on GitHub (Dec 3, 2018):

The /api/v1/admin APIs is for site administrator. I think it could do anything for management convenience.

@lunny commented on GitHub (Dec 3, 2018): The `/api/v1/admin` APIs is for site administrator. I think it could do anything for management convenience.
Author
Owner

@zeripath commented on GitHub (Dec 27, 2018):

Heya! Have you considered using the Sudo API feature to get this information? That way you can do this in Gitea 1.6.0 without waiting for these new APIs.

A lot of deficiencies with the API can simply be workarounded using Sudo.

@zeripath commented on GitHub (Dec 27, 2018): Heya! Have you considered using the Sudo API feature to get this information? That way you can do this in Gitea 1.6.0 without waiting for these new APIs. A lot of deficiencies with the API can simply be workarounded using Sudo.
Author
Owner

@6543 commented on GitHub (Sep 17, 2020):

close this, as zeripath pointed to sudo option ...

If a specific api is needed, just as for that specific in a new issue

@6543 commented on GitHub (Sep 17, 2020): close this, as zeripath pointed to sudo option ... If a specific api is needed, just as for that specific in a new issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2016