diff options
author | David Svantesson <davidsvantesson@gmail.com> | 2020-01-17 08:34:37 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2020-01-17 09:34:37 +0200 |
commit | 3c07d03c0388d3b86138572401281b51f2db9282 (patch) | |
tree | 06eecf8b818ee8721a5dbfdd688eb5f45e5bef51 /models/user.go | |
parent | 36943e56d66a2d711a6b0c27219ce91a3ddc020a (diff) | |
download | gitea-3c07d03c0388d3b86138572401281b51f2db9282.tar.gz gitea-3c07d03c0388d3b86138572401281b51f2db9282.zip |
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 <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 { |