Commit graph

3 commits

Author SHA1 Message Date
forgejo-backport-action
fb0ab1e5fa [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/13215

Followup of the refactor adding setter/getter to APIContext  https://codeberg.org/forgejo/forgejo/pulls/13143

- Only has an impact on the getters used by `routers/api/v1/permissions`
- When GetX and X both exist, remove GetX
- When GetX exists and X does not, rename GetX to X
- GetOrg is an exception as it would conflict with Org and is renamed Organization. This is due to APIContext having its own Org structure that includes an Organization.

Co-authored-by: limiting-factor <limiting-factor@posteo.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13217
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-06-27 22:44:01 +02:00
limiting-factor
76ca2dc503 chore(refactor): s/Base.Data["requiredScopeCategories"]/APIContext.RequiredScopeCategories/ (#13138)
Move from storing in the untyped Base.Data disctionary to a typed field of APIContext.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13138
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-06-23 20:04:19 +02:00
limiting-factor
17616708fd
feat: interface for REST API permissions
and a concrete implementation for testing and re-use
2026-06-20 22:58:56 +02:00