gitforge/routers/api/v1/permissions
limiting-factor 22e87b2441 [v16.0/forgejo] chore(refactor): clarify REST API permissions tests (#13271) (#13312)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/13271

- separate test cases from fixtures
  - testcase.go: A `testCase` describes a test using `testData`
  - fixture.go: `fixture*` are function that creates the conditions for this test  case to run
- move the testData closer to the beginning
- update the README.md

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13271
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
(cherry picked from commit c1351e62d4)

```
Conflicts:
	routers/api/v1/permissions/tests/README.md
   one line because coverage targets are not the same in v15, keep the
   non coverage documentation
	routers/api/v1/permissions/tests/check_fork_destination.go
   ignore as it only exists in the main branch
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13312
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-07-06 00:11:53 +02:00
..
testhelpers chore(refactor): run routers/api/v1/permissions/tests from tests/integration (#13157) 2026-06-21 21:43:57 +02:00
tests [v16.0/forgejo] chore(refactor): clarify REST API permissions tests (#13271) (#13312) 2026-07-06 00:11:53 +02:00
api_authorization.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
check_token_public_only.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
helpers.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
individual_perms_checker.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
interface.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
must_allow_pulls.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
must_enable_attachments.go chore: refactor REST API permission check 2026-06-20 22:58:56 +02:00
must_enable_issues.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
must_enable_issues_or_pulls.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
must_enable_local_issues_if_is_issue.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
must_enable_wiki.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
must_not_be_archived.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
permissions.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
repo_access.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_admin.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_any_repo_reader.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_basic_or_rev_proxy_auth.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_explore_sign_in.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_git_hook.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_org_membership.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_org_ownership.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_owner.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_package_access.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_repo_branch_writer.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_repo_reader.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_repo_writer.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_self_or_admin.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_site_admin.go chore: refactor REST API permission check 2026-06-20 22:58:56 +02:00
req_team_membership.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_token.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_users_explore_enabled.go chore: refactor REST API permission check 2026-06-20 22:58:56 +02:00
req_valid_comment_id.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00
req_webhooks_enabled.go chore: refactor REST API permission check 2026-06-20 22:58:56 +02:00
token_requires_repo_owner_scope.go chore: refactor REST API permission check 2026-06-20 22:58:56 +02:00
token_requires_scopes.go [v16.0/forgejo] chore(refactor): remove GetX redundant accessors and use X in services/context/api.go (#13217) 2026-06-27 22:44:01 +02:00