diff options
author | Unknwon <u@gogs.io> | 2015-03-24 18:14:04 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-03-24 18:14:04 -0400 |
commit | 6f81c05dde2def51c30a97f65f901ae45c971e05 (patch) | |
tree | d05c93bf9c941e8b3aac98a40ca854285e472020 /models/access.go | |
parent | ab6b2881412bbb039f0bf6a829586b434f4bd65b (diff) | |
download | gitea-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.go | 5 |
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 { |