diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-07-24 15:46:40 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-07-24 15:50:12 -0400 |
commit | b9b2d08638131be9861cb8d7e4f645a9013dd03f (patch) | |
tree | 0fdd8567ea4b824f986dc3826b1cf972c1a455eb /app/services/issuable_base_service.rb | |
parent | e496c35fedeb44648dec363acac1e6e30722d1b7 (diff) | |
download | gitlab-ce-b9b2d08638131be9861cb8d7e4f645a9013dd03f.tar.gz |
Dynamically check `:admin_*` ability in IssuableBaseServicers-issue-2092
Closes #2092
Diffstat (limited to 'app/services/issuable_base_service.rb')
-rw-r--r-- | app/services/issuable_base_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb index f1ef5ca84fe..15b3825f96a 100644 --- a/app/services/issuable_base_service.rb +++ b/app/services/issuable_base_service.rb @@ -27,8 +27,10 @@ class IssuableBaseService < BaseService old_branch, new_branch) end - def filter_params - unless can?(current_user, :admin_issue, project) + def filter_params(issuable_ability_name = :issue) + ability = :"admin_#{issuable_ability_name}" + + unless can?(current_user, ability, project) params.delete(:milestone_id) params.delete(:label_ids) params.delete(:assignee_id) |