aboutsummaryrefslogtreecommitdiffstats
path: root/models/access.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-24 18:14:04 -0400
committerUnknwon <u@gogs.io>2015-03-24 18:14:04 -0400
commit6f81c05dde2def51c30a97f65f901ae45c971e05 (patch)
treed05c93bf9c941e8b3aac98a40ca854285e472020 /models/access.go
parentab6b2881412bbb039f0bf6a829586b434f4bd65b (diff)
downloadgitea-6f81c05dde2def51c30a97f65f901ae45c971e05.tar.gz
gitea-6f81c05dde2def51c30a97f65f901ae45c971e05.zip
#1143 Team member access lost when adding repository collaborator
- fix bug when add a repo to team, all other team members gets access as well
Diffstat (limited to 'models/access.go')
-rw-r--r--models/access.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/access.go b/models/access.go
index ea2f7f7b4b..dd856afb71 100644
--- a/models/access.go
+++ b/models/access.go
@@ -170,8 +170,13 @@ func (repo *Repository) recalculateTeamAccesses(e Engine, ignTeamID int64) (err
if t.ID == ignTeamID {
continue
}
+
+ // Owner team gets owner access, and skip for teams that do not
+ // have relations with repository.
if t.IsOwnerTeam() {
t.Authorize = ACCESS_MODE_OWNER
+ } else if !t.hasRepository(e, repo.Id) {
+ continue
}
if err = t.getMembers(e); err != nil {