From da6e9f63df7411ecbe630178fd4bb694e537c453 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 20 Apr 2023 08:19:13 +0900 Subject: 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 --- models/organization/org.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'models/organization') 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, }) } -- cgit v1.2.3