aboutsummaryrefslogtreecommitdiffstats
path: root/models/org_team.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-10-15 02:55:21 +0200
committerzeripath <art27@cantab.net>2019-10-15 01:55:21 +0100
commit8ad26976114c4fed6269a40e52632d065167bd20 (patch)
treeb6c13ca7d7390ce8fd28354287c3b0b4ef3cb291 /models/org_team.go
parent733c898a907b23fa9e0c1bf108be5c5d9f9f7eb0 (diff)
downloadgitea-8ad26976114c4fed6269a40e52632d065167bd20.tar.gz
gitea-8ad26976114c4fed6269a40e52632d065167bd20.zip
Recalculate repository access only for specific user (#8481)
* Recalculate repository access only for specific user Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Handle user repositories as well, and only add access if minimum mode * Need to get repo owner to check if organization
Diffstat (limited to 'models/org_team.go')
-rw-r--r--models/org_team.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/org_team.go b/models/org_team.go
index 9170ea2c2a..10d53e3a86 100644
--- a/models/org_team.go
+++ b/models/org_team.go
@@ -723,7 +723,7 @@ func AddTeamMember(team *Team, userID int64) error {
// Give access to team repositories.
for _, repo := range team.Repos {
- if err := repo.recalculateTeamAccesses(sess, 0); err != nil {
+ if err := repo.recalculateUserAccess(sess, userID); err != nil {
return err
}
if setting.Service.AutoWatchNewRepos {
@@ -768,7 +768,7 @@ func removeTeamMember(e *xorm.Session, team *Team, userID int64) error {
// Delete access to team repositories.
for _, repo := range team.Repos {
- if err := repo.recalculateTeamAccesses(e, 0); err != nil {
+ if err := repo.recalculateUserAccess(e, userID); err != nil {
return err
}