@@ -615,20 +615,6 @@ func (u *User) GetRepositories(page, pageSize int) (err error) {
615
615
return err
616
616
}
617
617
618
- // GetRepositoryIDs returns repositories IDs where user owned and has unittypes
619
- func (u * User ) GetRepositoryIDs (units ... UnitType ) ([]int64 , error ) {
620
- var ids []int64
621
-
622
- sess := x .Table ("repository" ).Cols ("repository.id" )
623
-
624
- if len (units ) > 0 {
625
- sess = sess .Join ("INNER" , "repo_unit" , "repository.id = repo_unit.repo_id" )
626
- sess = sess .In ("repo_unit.type" , units )
627
- }
628
-
629
- return ids , sess .Where ("owner_id = ?" , u .ID ).Find (& ids )
630
- }
631
-
632
618
// UnitRepositoriesSubQuery returns repositories query builder according units
633
619
func (u * User ) UnitRepositoriesSubQuery (units ... UnitType ) * builder.Builder {
634
620
b := builder .Select ("repository.id" ).From ("repository" )
@@ -640,38 +626,6 @@ func (u *User) UnitRepositoriesSubQuery(units ...UnitType) *builder.Builder {
640
626
return b .Where (builder.Eq {"owner_id" : u .ID })
641
627
}
642
628
643
- // GetOrgRepositoryIDs returns repositories IDs where user's team owned and has unittypes
644
- func (u * User ) GetOrgRepositoryIDs (units ... UnitType ) ([]int64 , error ) {
645
- var ids []int64
646
-
647
- sess := x .Table ("repository" ).
648
- Cols ("repository.id" ).
649
- Join ("INNER" , "team_user" , "repository.owner_id = team_user.org_id" ).
650
- Join ("INNER" , "team_repo" , "repository.is_private != ? OR (team_user.team_id = team_repo.team_id AND repository.id = team_repo.repo_id)" , true )
651
-
652
- if len (units ) > 0 {
653
- sess = sess .Join ("INNER" , "team_unit" , "team_unit.team_id = team_user.team_id" )
654
- sess = sess .In ("team_unit.type" , units )
655
- }
656
-
657
- return ids , sess .
658
- Where ("team_user.uid = ?" , u .ID ).
659
- GroupBy ("repository.id" ).Find (& ids )
660
- }
661
-
662
- // GetAccessRepoIDs returns all repositories IDs where user's or user is a team member organizations
663
- func (u * User ) GetAccessRepoIDs (units ... UnitType ) ([]int64 , error ) {
664
- ids , err := u .GetRepositoryIDs (units ... )
665
- if err != nil {
666
- return nil , err
667
- }
668
- ids2 , err := u .GetOrgRepositoryIDs (units ... )
669
- if err != nil {
670
- return nil , err
671
- }
672
- return append (ids , ids2 ... ), nil
673
- }
674
-
675
629
// GetMirrorRepositories returns mirror repositories that user owns, including private repositories.
676
630
func (u * User ) GetMirrorRepositories () ([]* Repository , error ) {
677
631
return GetUserMirrorRepositories (u .ID )
0 commit comments