1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-07-24 20:19:39 +02:00
forgejo/models/repo
oliverpool cee2aae4ca fix: corrupted wiki unit default permission (#8234 follow-up) (#8258)
Closes #8119, follow-up of #8234

#8234 "only" fixed the case when a new wiki setting was applied.

However it lacked 2 aspects:
- fixing the already corrupted unit permission in the database (required a migration)
- fixing the API route

Both aspects should now be covered.

Additionally, I commented out the unused `UnitAccessMode` and indicated that they are only used for the wiki-unit (hopefully saving some time to future code-readers).

### Testing

- go to a commit before #8234 (e.g. 285f66b782)
- create 3 repositories
  - save the wiki settings of the second, without any change
  - set the wiki of the third to be globally writable
- verify the `default_permissions` column in the database, of the unit `5`: 0, 2, 3
- stop Forgejo, switch to this PR and start Forgejo
- verify that the logs writes `Migration[35]: Fix wiki unit default permission`
- verify the `default_permissions` column in the database, of the unit `5`: 0, 0, 3

Before:

![2025-06-23-150055.png](/attachments/1eb92507-b8b4-422c-921c-4296a91172e7)

After:

![2025-06-23-150853.png](/attachments/c7b53397-54fe-487d-89da-e10b26538cde)

- [x] I did not document these changes and I do not expect someone else to do it.
- [x] I do not want this change to show in the release notes.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8258
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-07-07 18:04:00 +02:00
..
TestSearchRepositoryIDsByCondition fix: ensure consistent empty repository topics field (#7920) 2025-05-29 22:39:53 +02:00
archive_download_count.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
archive_download_count_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
archiver.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
attachment.go fix: allow instance API URLs in release assets (#7644) 2025-06-09 10:01:59 +02:00
attachment_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
avatar.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
collaboration.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
collaboration_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
following_repo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
following_repo_test.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
fork.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
fork_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
git.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
language_stats.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
language_stats_test.go chore: remove usages of sort.Sort (#6689) 2025-01-26 13:30:00 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
mirror.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
moderation.go feat!: Abusive content reporting (#6977) 2025-05-18 08:05:16 +00:00
pushmirror.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pushmirror_test.go chore: QoL improvements to tests (#7917) 2025-05-21 15:45:56 +02:00
redirect.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
redirect_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_list_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo.go fix: ensure consistent empty repository topics field (#7920) 2025-05-29 22:39:53 +02:00
repo_flags.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_flags_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_indexer.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_list_test.go chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7648) 2025-04-25 09:14:33 +00:00
repo_repository.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_unit.go fix: corrupted wiki unit default permission (#8234 follow-up) (#8258) 2025-07-07 18:04:00 +02:00
repo_unit_test.go fix: corrupted wiki unit default permission (#8234 follow-up) (#8258) 2025-07-07 18:04:00 +02:00
search.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
star.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
star_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
topic.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
topic_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
update.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
upload.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
user_repo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
user_repo_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
watch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
watch_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
wiki.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
wiki_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00