* Add User.IsRestricted & UI to edit it
* Pass user object instead of user id to places where IsRestricted flag matters
* Restricted users: maintain access rows for all referenced repos (incl public)
* Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses
* Add basic repo access tests for restricted users
Signed-off-by: Manush Dodunekov <manush@stendahls.se>
Join("INNER","team_repo","repository.is_private != ? OR (team_user.team_id = team_repo.team_id AND repository.id = team_repo.repo_id)",true).
Join("INNER","team_repo","(? != ? and repository.is_private != ?) OR (team_user.team_id = team_repo.team_id AND repository.id = team_repo.repo_id)",true,u.IsRestricted,true).
Where("team_user.uid = ?",u.ID).
GroupBy("repository.id").Find(&ids);err!=nil{
returnnil,err
@ -1470,7 +1471,7 @@ type SearchUserOptions struct {
OrderBySearchOrderBy
Pageint
Privatebool// Include private orgs in search
OwnerIDint64// id of user for visibility calculation
Actor*User// The user doing the search
PageSizeint// Can be smaller than or equal to setting.UI.ExplorePagingNum
IsActiveutil.OptionalBool
SearchByEmailbool// Search by email as well as username/full name