diff options
author | yp05327 <576951401@qq.com> | 2023-04-20 08:19:13 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 19:19:13 -0400 |
commit | da6e9f63df7411ecbe630178fd4bb694e537c453 (patch) | |
tree | 75c69ecf2d2a834d24d8fe0e6db4a25393ed922d /models/organization | |
parent | 94210633ae64dcd1f5f9bdb046f888be526fe2da (diff) | |
download | gitea-da6e9f63df7411ecbe630178fd4bb694e537c453.tar.gz gitea-da6e9f63df7411ecbe630178fd4bb694e537c453.zip |
Add owner team permission check test (#24096)
Add test for https://github.com/go-gitea/gitea/pull/23675
Should be merged after #24117
---------
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'models/organization')
-rw-r--r-- | models/organization/org.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/models/organization/org.go b/models/organization/org.go index 53b020d704..30b76fb1a0 100644 --- a/models/organization/org.go +++ b/models/organization/org.go @@ -342,11 +342,15 @@ func CreateOrganization(org *Organization, owner *user_model.User) (err error) { // insert units for team units := make([]TeamUnit, 0, len(unit.AllRepoUnitTypes)) for _, tp := range unit.AllRepoUnitTypes { + up := perm.AccessModeOwner + if tp == unit.TypeExternalTracker || tp == unit.TypeExternalWiki { + up = perm.AccessModeRead + } units = append(units, TeamUnit{ OrgID: org.ID, TeamID: t.ID, Type: tp, - AccessMode: perm.AccessModeOwner, + AccessMode: up, }) } |