diff options
author | Unknown <joe2010xtmf@163.com> | 2014-06-25 05:14:36 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-06-25 05:14:36 -0400 |
commit | 43b33440b53c79a22de08880851b5b55e9b6a4b3 (patch) | |
tree | 4ae44f5d94aa99149035c04e518a91090fe4932a /models/user.go | |
parent | 72ba273cc99589d7a0ca0a7986939e86f6599bf8 (diff) |
Work on create organization repo and #257
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/models/user.go b/models/user.go index 2388be9a..f67911ca 100644 --- a/models/user.go +++ b/models/user.go @@ -123,11 +123,14 @@ func (u *User) GetOrganizations() error { return nil } -// Member represents user is member of organization. -type Member struct { - Id int64 - OrgId int64 `xorm:"unique(member) index"` - UserId int64 `xorm:"unique(member)"` +// GetOwnerTeam returns owner team of organization. +func (org *User) GetOwnerTeam() (*Team, error) { + t := &Team{ + OrgId: org.Id, + Name: OWNER_TEAM, + } + _, err := x.Get(t) + return t, err } // IsUserExist checks if given user name exist, @@ -249,7 +252,7 @@ func CreateOrganization(org, owner *User) (*User, error) { // Create default owner team. t := &Team{ OrgId: org.Id, - Name: "Owner", + Name: OWNER_TEAM, Authorize: ORG_ADMIN, NumMembers: 1, } |