Unable to manage not owned teams as site admin #3262

Closed
opened 2025-11-02 05:05:51 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @tarelda on GitHub (Apr 28, 2019).

  • Gitea version (or commit ref): 3725eef
  • Git version: Not relevant
  • Operating system: Not relevant
  • Database (use [x]):
    • PostgreSQL
    • [ x ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [ x ] Not relevant
  • Log gist:

Description

Long story short, I am trying to add users to organisation that I don't own. As site admin I am able to create org, but not list org teams etc.

Originally created by @tarelda on GitHub (Apr 28, 2019). - Gitea version (or commit ref): 3725eef - Git version: Not relevant - Operating system: Not relevant - Database (use `[x]`): - [ ] PostgreSQL - [ x ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ x ] Not relevant - Log gist: ## Description Long story short, I am trying to add users to organisation that I don't own. As site admin I am able to create org, but not list org teams etc.
GiteaMirror added the type/proposal label 2025-11-02 05:05:51 -06:00
Author
Owner

@tarelda commented on GitHub (May 4, 2019):

Check another scenario with sudo, and when changing user to the one owning organization everything works fine.
Thus I tried to track down the problem and judging by error message "Must be an organization member" and function reqOrgMembership
2933ae4e88/routers/api/v1/api.go (L328)
it seems that root cause is function isUserSiteAdmin.
0af0b078f9/modules/context/context.go (L50)
One of the sides of condition must be false. I hope someone with better gitea understanding can provide some inside which of the variables might not be properly set up.

@tarelda commented on GitHub (May 4, 2019): Check another scenario with sudo, and when changing user to the one owning organization everything works fine. Thus I tried to track down the problem and judging by error message "Must be an organization member" and function reqOrgMembership https://github.com/go-gitea/gitea/blob/2933ae4e88bb954af76c4e1e67c7ab1e4892e4a4/routers/api/v1/api.go#L328 it seems that root cause is function isUserSiteAdmin. https://github.com/go-gitea/gitea/blob/0af0b078f9f2f56615086de2fb50676266c59752/modules/context/context.go#L50 One of the sides of condition must be false. I hope someone with better gitea understanding can provide some inside which of the variables might not be properly set up.
Author
Owner

@ngourdon commented on GitHub (May 7, 2019):

The commit 3725eef seems to be in the branch release/v1.8.
The lines of code you mentioned are from the master branch. These are not from the release/v1.8.
There have been improvement of permission checks for API in the master branch (commit 49b2f45)

Which Gitea version are you using?
Are you using API or web UI?

@ngourdon commented on GitHub (May 7, 2019): The commit 3725eef seems to be in the branch `release/v1.8`. The lines of code you mentioned are from the `master` branch. These are not from the `release/v1.8`. There have been improvement of permission checks for API in the master branch (commit 49b2f45) Which Gitea version are you using? Are you using API or web UI?
Author
Owner

@tarelda commented on GitHub (May 9, 2019):

My bad, I completely forgot about checking out to release v1.8, that I was using. I can directly point out 49b2f45 as a fix to the issue (just by reading the flow of reqOrgMembership).

@tarelda commented on GitHub (May 9, 2019): My bad, I completely forgot about checking out to release v1.8, that I was using. I can directly point out 49b2f45 as a fix to the issue (just by reading the flow of reqOrgMembership).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3262