Browse Source
Add team option to grant rights for all organization repositories (#8688)
Add team option to grant rights for all organization repositories (#8688)
* Add field IsAllRepositories to team
* Add AllRepositories to team UI
* Manage team with access to all repositories
* Add field IsAllRepositories to team API
* put backticks around table/column names
* rename IsAllRepositories to IncludesAllRepositories
* do not reload slice if already loaded
* add repo to teams with access to all repositories when changing repo owner
* improve tests for teams with access to all repositories
* Merge branch 'master'
* Change code for adding all repositories
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* fmt after merge
* Change code in API EditTeam similar to EditTeamPost web interface
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Clarify that all repositories will be added
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* All repositories option under Permissions headline
* New setting group 'Repository access'
* Move check IncludeAllRepositories to removeRepository.
* Revert "Move check IncludeAllRepositories to removeRepository." and add comment instead.
This reverts commit 753b7d205b
.
* Clarify help text what options do.
lunny/display_deleted_branch2
committed by
Lauris BH
17 changed files with 382 additions and 75 deletions
-
40integrations/api_team_test.go
-
2models/migrations/migrations.go
-
25models/migrations/v105.go
-
14models/org.go
-
70models/org_team.go
-
137models/org_team_test.go
-
29models/repo.go
-
1modules/auth/org.go
-
19modules/structs/org_team.go
-
8options/locale/locale_en-US.ini
-
11routers/api/v1/convert/convert.go
-
31routers/api/v1/org/team.go
-
20routers/org/teams.go
-
18templates/org/team/new.tmpl
-
2templates/org/team/repositories.tmpl
-
18templates/org/team/sidebar.tmpl
-
12templates/swagger/v1_json.tmpl
@ -0,0 +1,25 @@ |
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|||
// Use of this source code is governed by a MIT-style
|
|||
// license that can be found in the LICENSE file.
|
|||
|
|||
package migrations |
|||
|
|||
import ( |
|||
"xorm.io/xorm" |
|||
) |
|||
|
|||
func addTeamIncludesAllRepositories(x *xorm.Engine) error { |
|||
|
|||
type Team struct { |
|||
ID int64 `xorm:"pk autoincr"` |
|||
IncludesAllRepositories bool `xorm:"NOT NULL DEFAULT false"` |
|||
} |
|||
|
|||
if err := x.Sync2(new(Team)); err != nil { |
|||
return err |
|||
} |
|||
|
|||
_, err := x.Exec("UPDATE `team` SET `includes_all_repositories` = ? WHERE `name`=?", |
|||
true, "Owners") |
|||
return err |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue