summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-15 18:29:41 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-15 18:29:41 +0800
commit36b4c57ff13198196134b853f624fb633061734d (patch)
treee973d2aad41823e50c951a08ec8742030141d675 /models/user.go
parent3e32b14ad4da2db1b05eeec73936dbbe79cecc45 (diff)
downloadgitea-36b4c57ff13198196134b853f624fb633061734d.tar.gz
gitea-36b4c57ff13198196134b853f624fb633061734d.zip
Finish new organization members and invitation page
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index f4526b51d1..757c290b9c 100644
--- a/models/user.go
+++ b/models/user.go
@@ -128,6 +128,16 @@ func (u *User) IsOrganization() bool {
return u.Type == ORGANIZATION
}
+// IsUserOrgOwner returns true if user is in the owner team of given organization.
+func (u *User) IsUserOrgOwner(orgId int64) bool {
+ return IsOrganizationOwner(orgId, u.Id)
+}
+
+// IsPublicMember returns true if user public his/her membership in give organization.
+func (u *User) IsPublicMember(orgId int64) bool {
+ return IsPublicMembership(orgId, u.Id)
+}
+
// GetOrganizationCount returns count of membership of organization of user.
func (u *User) GetOrganizationCount() (int64, error) {
return x.Where("uid=?", u.Id).Count(new(OrgUser))