Skip to content

API - list teams of an org with admin priviledges denied #6434

@vakabus

Description

@vakabus

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:

  1. logged in as an admin by using a token
  2. list teams, get "users" team id (GET /orgs/{org}/teams)
  3. 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

No one assigned

    Labels

    type/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions