Files
Gitea/tests
silverwindandBasavaraj S m 0c6645958b fix(api): hide org roles from non-members (#40042) (#40365)
Backport https://github.com/go-gitea/gitea/pull/40042

`GET /users/{username}/orgs/{org}/permissions` returned a user's team
roles to anyone who could see the org, revealing concealed members and
their roles. Now only the user, unrestricted org members and site admins
get the real answer, everyone else gets the non-member response:

- Outsiders get no roles, for public members too.
- Restricted members only get their own roles.
- Public-only tokens get none, and site admins need an `all`-scoped
token.

v28 lacks the doer token helpers from
https://github.com/go-gitea/gitea/pull/39690, so the check reads
`ctx.PublicOnly` and the request's token scope instead.

Assisted-by: Claude Code:claude-opus-5-5

Co-authored-by: Basavaraj S m <basavaraj@digiscrypt.com>
2026-11-14 12:19:34 +00:00
..