aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-19 14:43:38 +0800
committerGitHub <noreply@github.com>2020-01-19 14:43:38 +0800
commitf540d0ac87fe776e71c5caeba20049f46a667efe (patch)
tree71c115e7b4081ac013c92cfa4e8ad88c43e9dbaa /modules
parent0641965860bc5ebcb1c85067976099986d0136c6 (diff)
downloadgitea-f540d0ac87fe776e71c5caeba20049f46a667efe.tar.gz
gitea-f540d0ac87fe776e71c5caeba20049f46a667efe.zip
Fix issues/pulls dependencies problems (#9842)
* Fix issues/pulls dependencies problems * fix swagger and api param name * fix js
Diffstat (limited to 'modules')
-rw-r--r--modules/context/repo.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 66700a6937..3815fc8cea 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -138,8 +138,8 @@ func (r *Repository) CanUseTimetracker(issue *models.Issue, user *models.User) b
}
// CanCreateIssueDependencies returns whether or not a user can create dependencies.
-func (r *Repository) CanCreateIssueDependencies(user *models.User) bool {
- return r.Permission.CanWrite(models.UnitTypeIssues) && r.Repository.IsDependenciesEnabled()
+func (r *Repository) CanCreateIssueDependencies(user *models.User, isPull bool) bool {
+ return r.Repository.IsDependenciesEnabled() && r.Permission.CanWriteIssuesOrPulls(isPull)
}
// GetCommitsCount returns cached commit count for current view