-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
type/enhancementAn improvement of existing functionalityAn improvement of existing functionality
Milestone
Description
Hi,
I am trying to automate user registration and I've run into an issue, that I can't list teams of an organization without the authenticated user being in Owners of that org. Being an admin is ignored.
What I am doing:
- logged in as an admin by using a token
- list teams, get "users" team id (
GET /orgs/{org}/teams
) - add an user to team id from above (
PUT /teams/{id}/members/{username}
)
What fails:
Step number 2 fails with this response:
{"message":"Must be an organization member","url":"https://godoc.org/github.com/go-gitea/go-sdk/gitea"}
Versions tested:
The same behavior was observed on version 1.7.2 as well as on version 1.8.0 (c5ec66a
)
What was expected:
Because I am authenticated as an admin, I expected there wouldn't be such check. The API call should in my opinion pass and really return the list of teams.
Is there more correct way to add members to teams? The same thing I am trying to automate is possible via web UI. That's why I expected it to work. Or if this is the correct way, I think this check should be passed by being an administrator.
Thanks for any help!
Metadata
Metadata
Assignees
Labels
type/enhancementAn improvement of existing functionalityAn improvement of existing functionality