From 3c07d03c0388d3b86138572401281b51f2db9282 Mon Sep 17 00:00:00 2001 From: David Svantesson Date: Fri, 17 Jan 2020 08:34:37 +0100 Subject: Add setting to set default and global disabled repository units. (#8788) * Add possibility to global disable repo units. * Add Default Repo Unit app.ini setting. * Hide units * Hide disabled repo units * Minor fixes * Indicate disabled units in team settings. Co-authored-by: Lauris BH Co-authored-by: Lunny Xiao Co-authored-by: zeripath --- models/user.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'models/user.go') diff --git a/models/user.go b/models/user.go index d7129fb09a..4a4af3547a 100644 --- a/models/user.go +++ b/models/user.go @@ -622,6 +622,7 @@ func (u *User) GetRepositories(page, pageSize int) (err error) { } // GetRepositoryIDs returns repositories IDs where user owned and has unittypes +// Caller shall check that units is not globally disabled func (u *User) GetRepositoryIDs(units ...UnitType) ([]int64, error) { var ids []int64 @@ -636,6 +637,7 @@ func (u *User) GetRepositoryIDs(units ...UnitType) ([]int64, error) { } // GetOrgRepositoryIDs returns repositories IDs where user's team owned and has unittypes +// Caller shall check that units is not globally disabled func (u *User) GetOrgRepositoryIDs(units ...UnitType) ([]int64, error) { var ids []int64 @@ -656,6 +658,7 @@ func (u *User) GetOrgRepositoryIDs(units ...UnitType) ([]int64, error) { } // GetAccessRepoIDs returns all repositories IDs where user's or user is a team member organizations +// Caller shall check that units is not globally disabled func (u *User) GetAccessRepoIDs(units ...UnitType) ([]int64, error) { ids, err := u.GetRepositoryIDs(units...) if err != nil { -- cgit v1.2.3