fix collborators lack of units on orgnization repositories (#1968)

* fix collborators lack of units on orgnization repositories

* also change log level to debug
This commit is contained in:
Lunny Xiao 2017-06-15 10:50:12 +08:00 committed by Kim "BKC" Carlbäcker
parent 5b0cbf3788
commit 31b5e9177f
26 changed files with 614 additions and 6 deletions

View file

@ -37,3 +37,43 @@
index: 0
config: "{}"
created_unix: 946684810
-
id: 6
repo_id: 3
type: 1
index: 0
config: "{}"
created_unix: 946684810
-
id: 7
repo_id: 3
type: 2
index: 0
config: "{}"
created_unix: 946684810
-
id: 8
repo_id: 3
type: 3
index: 0
config: "{}"
created_unix: 946684810
-
id: 9
repo_id: 3
type: 5
index: 0
config: "{}"
created_unix: 946684810
-
id: 10
repo_id: 3
type: 7
index: 0
config: "{}"
created_unix: 946684810

View file

@ -363,6 +363,13 @@ func (repo *Repository) getUnitsByUserID(e Engine, userID int64, isAdmin bool) (
return nil
}
// Collaborators will not be limited
if isCollaborator, err := repo.isCollaborator(e, userID); err != nil {
return err
} else if isCollaborator {
return nil
}
teams, err := getUserTeams(e, repo.OwnerID, userID)
if err != nil {
return err