mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-16 10:21:06 +00:00
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>