mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-24 02:18:46 +03:00

Follow #33127 This PR add backend logic and test for "anonymous access", it shares the same logic as "everyone access", so not too much change. By the way, split `SettingsPost` into small functions to make it easier to make frontend-related changes in the future. Next PR will add frontend support for "anonymous access"
18 lines
393 B
Go
18 lines
393 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_24 //nolint
|
|
|
|
import (
|
|
"code.gitea.io/gitea/models/perm"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func AddRepoUnitAnonymousAccessMode(x *xorm.Engine) error {
|
|
type RepoUnit struct { //revive:disable-line:exported
|
|
AnonymousAccessMode perm.AccessMode `xorm:"NOT NULL DEFAULT 0"`
|
|
}
|
|
return x.Sync(&RepoUnit{})
|
|
}
|