Commit 7aff453c authored by Sean McGivern's avatar Sean McGivern

Fix EE-only commands to not permit commits

parent 6d11e387
...@@ -9,12 +9,13 @@ module EE ...@@ -9,12 +9,13 @@ module EE
end end
params '@user1 @user2' params '@user1 @user2'
condition do condition do
issuable.allows_multiple_assignees? && issuable.is_a?(::Issuable) &&
issuable.allows_multiple_assignees? &&
issuable.persisted? && issuable.persisted? &&
current_user.can?(:"admin_#{issuable.to_ability_name}", project) current_user.can?(:"admin_#{issuable.to_ability_name}", project)
end end
command :reassign do |unassign_param| command :reassign do |reassign_param|
@updates[:assignee_ids] = extract_users(unassign_param).map(&:id) @updates[:assignee_ids] = extract_users(reassign_param).map(&:id)
end end
desc 'Set weight' desc 'Set weight'
...@@ -23,7 +24,8 @@ module EE ...@@ -23,7 +24,8 @@ module EE
end end
params "0, 1, 2, …" params "0, 1, 2, …"
condition do condition do
issuable.supports_weight? && issuable.is_a?(::Issuable) &&
issuable.supports_weight? &&
current_user.can?(:"admin_#{issuable.to_ability_name}", issuable) current_user.can?(:"admin_#{issuable.to_ability_name}", issuable)
end end
parse_params do |weight| parse_params do |weight|
...@@ -36,7 +38,8 @@ module EE ...@@ -36,7 +38,8 @@ module EE
desc 'Clear weight' desc 'Clear weight'
explanation 'Clears weight.' explanation 'Clears weight.'
condition do condition do
issuable.persisted? && issuable.is_a?(::Issuable) &&
issuable.persisted? &&
issuable.supports_weight? && issuable.supports_weight? &&
issuable.weight? && issuable.weight? &&
current_user.can?(:"admin_#{issuable.to_ability_name}", issuable) current_user.can?(:"admin_#{issuable.to_ability_name}", issuable)
......
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