diff --git a/models/team_list.go b/models/team_list.go index 85b512dbbb..8d3c4ca3d6 100644 --- a/models/team_list.go +++ b/models/team_list.go @@ -18,3 +18,8 @@ type TeamList struct { func (TeamList) TableName() string { return "team_list" } + +type teamWithRight struct { + Team `xorm:"extends"` + Right TeamRight `json:"right"` +} \ No newline at end of file diff --git a/models/team_list_readall.go b/models/team_list_readall.go index abbca4b5f3..e68f1b1296 100644 --- a/models/team_list_readall.go +++ b/models/team_list_readall.go @@ -12,9 +12,8 @@ func (tl *TeamList) ReadAll(user *User) (interface{}, error) { } // Get the teams - all := []*Team{} - - err = x.Select("teams.*"). + all := []*teamWithRight{} + err = x. Table("teams"). Join("INNER", "team_list", "team_id = teams.id"). Where("team_list.list_id = ?", tl.ListID).