summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-16 10:14:12 -0500
committerUnknwon <u@gogs.io>2015-11-16 10:14:12 -0500
commit134d8e7681d098b8b37d4ee47cea0e03d643965d (patch)
treebd14c2318fce4b282687d41e77fba3b268bd4bc1 /models/user.go
parentc9b65f0fdcaebb23cc6071e86881f623e6b6a3e7 (diff)
downloadgitea-134d8e7681d098b8b37d4ee47cea0e03d643965d.tar.gz
gitea-134d8e7681d098b8b37d4ee47cea0e03d643965d.zip
work on #1961
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 5aaf630f4a..18dce976f6 100644
--- a/models/user.go
+++ b/models/user.go
@@ -109,6 +109,12 @@ func (u *User) AfterSet(colName string, _ xorm.Cell) {
}
}
+// HasForkedRepo checks if user has already forked a repository with given ID.
+func (u *User) HasForkedRepo(repoID int64) bool {
+ _, has := HasForkedRepo(u.Id, repoID)
+ return has
+}
+
// CanEditGitHook returns true if user can edit Git hooks.
func (u *User) CanEditGitHook() bool {
return u.IsAdmin || u.AllowGitHook