Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET /api/v1/orgs returns no organisations #16785

Closed
2 of 6 tasks
markusschaefer opened this issue Aug 23, 2021 · 4 comments · Fixed by #16866
Closed
2 of 6 tasks

GET /api/v1/orgs returns no organisations #16785

markusschaefer opened this issue Aug 23, 2021 · 4 comments · Fixed by #16866
Assignees
Labels
modifies/api This PR adds API routes or modifies them type/bug
Milestone

Comments

@markusschaefer
Copy link

  • Gitea version 1.15.0
  • Operating system: docker image gitea/gitea:1.15.0
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No

Description

The api call "/api/v1/orgs" returns an empty result although there are many organisations and the user is owner of these organisations.

@noerw
Copy link
Member

noerw commented Aug 23, 2021

Can't reproduce this. I think you need to be more specific about

  • the exact request you made
  • app.ini config: different settings affect visibility with/without authentication (eg REQUIRE_SIGNIN_VIEW)
  • permission model of the orgs: are those private/restricted?
  • permissions of the user owning the access token (are they admin?) also w.r.t. the orgs: are they member, did they create the org, was the org transferred?

@noerw noerw added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail modifies/api This PR adds API routes or modifies them labels Aug 23, 2021
@markusschaefer
Copy link
Author

Request is: GET /api/v1/orgs?token=XXX
app.ini REQUIRE_SIGNIN_VIEW is not set
visibility: "limited"
The User is gitea admin and owner of the orgs. The user created the orgs,

The request worked with gitea 1.14.6

With the request: GET /api/v1/orgs/myOrgName?token=XXX I can access every single org.

@noerw noerw added type/bug and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Aug 25, 2021
@6543
Copy link
Member

6543 commented Aug 29, 2021

If I had to guess, the Actor is not passed as searchOption

@6543 6543 self-assigned this Aug 29, 2021
6543 added a commit to 6543-forks/gitea that referenced this issue Aug 29, 2021
@6543 6543 added this to the 1.15.1 milestone Aug 29, 2021
@6543
Copy link
Member

6543 commented Aug 29, 2021

my guess was right - I alos found a similar bug on a second api :D

EDIT: @markusschaefer thanks for reporting!

techknowlogick pushed a commit that referenced this issue Aug 30, 2021
* fix bug #16785 and similar

* code format

* CI.restart()
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants