Commit 6d32c609 authored by Alex Kalderimis's avatar Alex Kalderimis

Use the epic: parameter to the issue service

parent 96a2b3db
......@@ -34,9 +34,5 @@ module Mutations
true
end
end
def can?(ability, subject)
Ability.allowed?(current_user, ability, subject)
end
end
end
......@@ -16,25 +16,8 @@ module EE
end
def resolve(**args)
if args.key?(:epic)
args[:epic_id] = epic_id(args.delete(:epic))
end
super(**args)
end
private
def epic_id(epic)
return unless epic
authorize_epic!(epic)
epic.id
end
def authorize_epic!(epic)
return if can?(:admin_epic, epic)
super
rescue ::Gitlab::Access::AccessDeniedError
raise_resource_not_available_error!
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment