This commit is contained in:
Unknwon 2015-11-16 10:14:12 -05:00
parent c9b65f0fdc
commit 134d8e7681
10 changed files with 47 additions and 24 deletions

View file

@ -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