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

[API] Org teams api does not return units #6354

Closed
mmarif4u opened this issue Mar 18, 2019 · 1 comment · Fixed by #6379
Closed

[API] Org teams api does not return units #6354

mmarif4u opened this issue Mar 18, 2019 · 1 comment · Fixed by #6379
Labels
Milestone

Comments

@mmarif4u
Copy link

  • Gitea version (or commit ref): 1.6.4

In API orgs/{org}/teams, units are empty. This also includes when creating a new team via API. It does not return or accept any units.

{
    "id": 7,
    "name": "alpha-devs-2",
    "description": "This is via API 2",
    "permission": "read",
    "units": null
}

This return null for post method and all units(permissions) in the web ui are disabled in this case.

{
  "description": "This is via API 2",
  "name": "alpha-devs-2",
  "permission": "read",
  "units": [
    "code"  ]
}
@mmarif4u
Copy link
Author

Further update on this.

So i created new team with:

{
  "description": "API team 2",
  "name": "API2",
  "permission": "write",
  "units": [
    "repo.issues", "repo.code"
  ]
}

That did work and returned:

{
    "id": 9,
    "name": "API2",
    "description": "API team 2",
    "permission": "write",
    "units": [
        "repo.issues",
        "repo.code"
    ]
}

Ref, /~https://github.com/go-gitea/gitea/blob/master/models/unit.go#L79

But the Get call still return null for units.

[
    {
        "id": 1,
        "name": "Owners",
        "description": "",
        "permission": "owner",
        "units": null
    },
    {
        "id": 8,
        "name": "API1",
        "description": "API team 1",
        "permission": "read",
        "units": null
    },
    {
        "id": 9,
        "name": "API2",
        "description": "API team 2",
        "permission": "write",
        "units": null
    }
]

@mmarif4u mmarif4u changed the title [API] Org teams api does not return or accept units [API] Org teams api does not return Mar 19, 2019
@mmarif4u mmarif4u changed the title [API] Org teams api does not return [API] Org teams api does not return units Mar 19, 2019
@lunny lunny added the type/bug label Mar 20, 2019
@lafriks lafriks added this to the 1.8.0 milestone Mar 25, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants