#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
This commit is contained in:
Unknwon 2015-03-24 18:14:04 -04:00
parent ab6b288141
commit 6f81c05dde
4 changed files with 20 additions and 4 deletions

View file

@ -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 {