chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#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.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13215
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
This commit is contained in:
limiting-factor 2026-06-27 18:34:52 +02:00 committed by Mathieu Fenniak
commit 423b6cb589
36 changed files with 161 additions and 185 deletions

View file

@ -220,33 +220,33 @@ forgejo.org/modules/zstd
Writer.Close
forgejo.org/routers/api/v1/permissions
Permissions.GetContext
Permissions.Context
Permissions.SetContext
Permissions.GetToken
Permissions.SetToken
Permissions.GetRepository
Permissions.Repository
Permissions.SetRepository
Permissions.GetDoer
Permissions.Doer
Permissions.SetDoer
Permissions.GetUser
Permissions.User
Permissions.SetUser
Permissions.GetOrg
Permissions.SetOrg
Permissions.GetTeam
Permissions.Organization
Permissions.SetOrganization
Permissions.Team
Permissions.SetTeam
Permissions.GetPackageOwner
Permissions.PackageOwner
Permissions.SetPackageOwner
Permissions.GetPackageAccessMode
Permissions.PackageAccessMode
Permissions.SetPackageAccessMode
Permissions.GetPermission
Permissions.Permission
Permissions.SetPermission
Permissions.GetIsSigned
Permissions.IsSigned
Permissions.SetIsSigned
Permissions.GetPublicOnly
Permissions.PublicOnly
Permissions.SetPublicOnly
Permissions.GetReducer
Permissions.Reducer
Permissions.SetReducer
Permissions.GetAuthentication
Permissions.Authentication
Permissions.SetAuthentication
Permissions.RequiredScopeCategories
Permissions.SetRequiredScopeCategories