summaryrefslogtreecommitdiff
path: root/app/models/board.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-17 18:10:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-17 18:10:42 +0000
commit49bb78aac34a111c0fb13aae3a83b078be351fd3 (patch)
tree510df08e78b39ef88631f8f25bdc371a4661caa9 /app/models/board.rb
parent68c476dbd8a2c670aeeebffce8b63b554a3ac7f0 (diff)
downloadgitlab-ce-49bb78aac34a111c0fb13aae3a83b078be351fd3.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/board.rb')
-rw-r--r--app/models/board.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/board.rb b/app/models/board.rb
index c13f17215df..7938819b6e4 100644
--- a/app/models/board.rb
+++ b/app/models/board.rb
@@ -45,6 +45,12 @@ class Board < ApplicationRecord
def to_type
self.class.to_type
end
+
+ def disabled_for?(current_user)
+ namespace = group_board? ? resource_parent.root_ancestor : resource_parent.root_namespace
+
+ namespace.issue_repositioning_disabled? || !Ability.allowed?(current_user, :create_non_backlog_issues, self)
+ end
end
Board.prepend_mod_with('Board')