summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-22 12:41:33 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 07:39:15 +0100
commit8d1b7f950708a0b759026816fcadb6324b29a208 (patch)
treec867371bfc7280f2496dfaf8aa3baa64aa7b7651 /app/services
parent14c983fb696b7b75065df2b5defd458e563444e3 (diff)
downloadgitlab-ce-8d1b7f950708a0b759026816fcadb6324b29a208.tar.gz
Add issue move ability and use it in move service
Diffstat (limited to 'app/services')
-rw-r--r--app/services/issues/move_service.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/services/issues/move_service.rb b/app/services/issues/move_service.rb
index 2cba6147429..8a39e2d5f4d 100644
--- a/app/services/issues/move_service.rb
+++ b/app/services/issues/move_service.rb
@@ -34,17 +34,14 @@ module Issues
end
def move?
- return false unless @project_new
- return false unless @issue_new
- return false unless can_move?
-
- true
+ @project_new && can_move?
end
private
def can_move?
- true
+ can?(@current_user, :move_issue, @project_old) &&
+ can?(@current_user, :move_issue, @project_new)
end
def open_new_issue