Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-02-15 00:19:59 +0300
committerStan Hu <stanhu@gmail.com>2019-02-15 00:41:43 +0300
commitb2da8042b4d11db246a26b63eebc78a3c0660b08 (patch)
tree69feead682ebd9c7ab55c569bab523f67bd03679 /app/models/board.rb
parentc470a77937c79169f3ba78a31c249bd71b5c6070 (diff)
Fix 403 errors when adding an assignee list in project boards
Due to a bug in `BoardPolicy`, users were getting back a 403 error when trying to assign users to an assignee list and seeing "Something went wrong while fetching assignees list". For some reason, the declarative policy runtime was ignoring the ternary condition. To work around the issue, we make the project board an explicit condition check. Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/9727
Diffstat (limited to 'app/models/board.rb')
-rw-r--r--app/models/board.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/board.rb b/app/models/board.rb
index a137863456c..758a71d6903 100644
--- a/app/models/board.rb
+++ b/app/models/board.rb
@@ -21,6 +21,10 @@ class Board < ActiveRecord::Base
group_id.present?
end
+ def project_board?
+ project_id.present?
+ end
+
def backlog_list
lists.merge(List.backlog).take
end