diff options
author | Unknwon <u@gogs.io> | 2015-10-08 22:38:42 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-10-08 22:38:42 -0400 |
commit | 01dc8f8a4f9a1eeb5608ad2f3c1181ef9afdac7e (patch) | |
tree | 33d9a679875099377dbd74f0ad54f144df944b07 | |
parent | aff49b1c9eaa33f7c530275f2695d6d96699ec5d (diff) | |
download | gitea-01dc8f8a4f9a1eeb5608ad2f3c1181ef9afdac7e.tar.gz gitea-01dc8f8a4f9a1eeb5608ad2f3c1181ef9afdac7e.zip |
fix change visivility of non-org does not affect forks
-rw-r--r-- | models/repo.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/models/repo.go b/models/repo.go index 7cfc9c824b..75e1cd3a9b 100644 --- a/models/repo.go +++ b/models/repo.go @@ -982,13 +982,11 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e if err = repo.getOwner(e); err != nil { return fmt.Errorf("getOwner: %v", err) } - if !repo.Owner.IsOrganization() { - return nil - } - - // Organization repository need to recalculate access table when visivility is changed. - if err = repo.recalculateTeamAccesses(e, 0); err != nil { - return fmt.Errorf("recalculateTeamAccesses: %v", err) + if repo.Owner.IsOrganization() { + // Organization repository need to recalculate access table when visivility is changed. + if err = repo.recalculateTeamAccesses(e, 0); err != nil { + return fmt.Errorf("recalculateTeamAccesses: %v", err) + } } forkRepos, err := getRepositoriesByForkID(e, repo.ID) |