mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-07-08 01:00:03 +02:00
Remove unit types commits and settings (#2161)
* Remove unit types commits and settings * Can not limit units in administrator teams * Limit changing units only to teams with read and write access mode * Small code optimization
This commit is contained in:
parent
047a67a90b
commit
f33e6ae09e
20 changed files with 174 additions and 104 deletions
|
@ -75,8 +75,8 @@ func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
|
|||
switch colName {
|
||||
case "type":
|
||||
switch UnitType(Cell2Int64(val)) {
|
||||
case UnitTypeCode, UnitTypeIssues, UnitTypePullRequests, UnitTypeCommits, UnitTypeReleases,
|
||||
UnitTypeWiki, UnitTypeSettings:
|
||||
case UnitTypeCode, UnitTypeIssues, UnitTypePullRequests, UnitTypeReleases,
|
||||
UnitTypeWiki:
|
||||
r.Config = new(UnitConfig)
|
||||
case UnitTypeExternalWiki:
|
||||
r.Config = new(ExternalWikiConfig)
|
||||
|
@ -116,11 +116,6 @@ func (r *RepoUnit) PullRequestsConfig() *UnitConfig {
|
|||
return r.Config.(*UnitConfig)
|
||||
}
|
||||
|
||||
// CommitsConfig returns config for UnitTypeCommits
|
||||
func (r *RepoUnit) CommitsConfig() *UnitConfig {
|
||||
return r.Config.(*UnitConfig)
|
||||
}
|
||||
|
||||
// ReleasesConfig returns config for UnitTypeReleases
|
||||
func (r *RepoUnit) ReleasesConfig() *UnitConfig {
|
||||
return r.Config.(*UnitConfig)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue