summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-24 21:09:05 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-24 21:09:05 +0800
commit21a1b8e5a35c61bff30145ac3194ea893a9c6b68 (patch)
treeb218aedd0d64252d95725f12338a1ced1f155ba9 /models/user.go
parente325c8499a102ba8a6a84236c02dd7951f46cec5 (diff)
downloadgitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.tar.gz
gitea-21a1b8e5a35c61bff30145ac3194ea893a9c6b68.zip
Finish new edit team page, add member to team
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 757c290b9c..e8db1ad157 100644
--- a/models/user.go
+++ b/models/user.go
@@ -54,7 +54,8 @@ type User struct {
LoginSource int64 `xorm:"not null default 0"`
LoginName string
Type UserType
- Orgs []*User `xorm:"-"`
+ Orgs []*User `xorm:"-"`
+ Repos []*Repository `xorm:"-"`
NumFollowers int
NumFollowings int
NumStars int
@@ -143,6 +144,12 @@ func (u *User) GetOrganizationCount() (int64, error) {
return x.Where("uid=?", u.Id).Count(new(OrgUser))
}
+// GetRepositories returns all repositories that user owns, including private repositories.
+func (u *User) GetRepositories() (err error) {
+ u.Repos, err = GetRepositories(u.Id, true)
+ return err
+}
+
// GetOrganizations returns all organizations that user belongs to.
func (u *User) GetOrganizations() error {
ous, err := GetOrgUsersByUserId(u.Id)