aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context/repo.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2018-07-17 23:23:58 +0200
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-07-17 17:23:58 -0400
commit1bff02de55331e11de3627d5c5628feb2cd97387 (patch)
treed6d6ace5f246c1555b294bf096763260f7d74d7b /modules/context/repo.go
parent7be5935c55dcdf198efdf1306bbeb2b54aa0b900 (diff)
downloadgitea-1bff02de55331e11de3627d5c5628feb2cd97387.tar.gz
gitea-1bff02de55331e11de3627d5c5628feb2cd97387.zip
Added dependencies for issues (#2196) (#2531)
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r--modules/context/repo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 1fe5482ce1..7239b353ff 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -104,6 +104,11 @@ func (r *Repository) CanUseTimetracker(issue *models.Issue, user *models.User) b
r.IsWriter() || issue.IsPoster(user.ID) || isAssigned)
}
+// CanCreateIssueDependencies returns whether or not a user can create dependencies.
+func (r *Repository) CanCreateIssueDependencies(user *models.User) bool {
+ return r.Repository.IsDependenciesEnabled() && r.IsWriter()
+}
+
// GetCommitsCount returns cached commit count for current view
func (r *Repository) GetCommitsCount() (int64, error) {
var contextName string