summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-26 15:45:45 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-26 15:45:45 +0200
commitd5947ada4493335d49368ec193f4b9b801582deb (patch)
tree3bd1d9a23a241fc8e1cd496530093b6bcc705695 /app
parentb9fa82daeeb91d8121e096fec0db4981b46dd5b9 (diff)
downloadgitlab-ce-d5947ada4493335d49368ec193f4b9b801582deb.tar.gz
Simplify set of assignee, milestone and label to admin_issue rule
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/pages/issues.scss6
-rw-r--r--app/models/ability.rb4
-rw-r--r--app/services/issuable_base_service.rb8
-rw-r--r--app/views/projects/issues/_issue.html.haml4
-rw-r--r--app/views/shared/issuable/_context.html.haml4
-rw-r--r--app/views/shared/issuable/_filter.html.haml5
-rw-r--r--app/views/shared/issuable/_form.html.haml4
7 files changed, 8 insertions, 27 deletions
diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss
index ed938f86b35..3572f33e91f 100644
--- a/app/assets/stylesheets/pages/issues.scss
+++ b/app/assets/stylesheets/pages/issues.scss
@@ -145,9 +145,3 @@ h2.issue-title {
.issue-form .select2-container {
width: 250px !important;
}
-
-.issues-holder {
- .issue-info {
- margin-left: 20px;
- }
-}
diff --git a/app/models/ability.rb b/app/models/ability.rb
index b611276cf9c..c90c99c5b5f 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -154,9 +154,6 @@ class Ability
project_guest_rules + [
:download_code,
:fork_project,
- :set_assignee,
- :set_milestone,
- :set_label,
:write_project_snippet
]
end
@@ -188,7 +185,6 @@ class Ability
:modify_issue,
:modify_project_snippet,
:modify_merge_request,
- :admin_issue,
:admin_milestone,
:admin_project_snippet,
:admin_project_member,
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb
index cb544eaf89b..f1ef5ca84fe 100644
--- a/app/services/issuable_base_service.rb
+++ b/app/services/issuable_base_service.rb
@@ -28,15 +28,9 @@ class IssuableBaseService < BaseService
end
def filter_params
- unless can?(current_user, :set_milestone, project)
+ unless can?(current_user, :admin_issue, project)
params.delete(:milestone_id)
- end
-
- unless can?(current_user, :set_label, project)
params.delete(:label_ids)
- end
-
- unless can?(current_user, :set_assignee, project)
params.delete(:assignee_id)
end
end
diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml
index 3791af55e92..cdb3839d13b 100644
--- a/app/views/projects/issues/_issue.html.haml
+++ b/app/views/projects/issues/_issue.html.haml
@@ -1,7 +1,7 @@
%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue) }
- - if controller.controller_name == 'issues'
+ - if controller.controller_name == 'issues' && can?(current_user, :admin_issue, @project)
.issue-check
- = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :set_assignee, issue)
+ = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue"
.issue-title
%span.issue-title-text
diff --git a/app/views/shared/issuable/_context.html.haml b/app/views/shared/issuable/_context.html.haml
index 5fb6c5155cb..46990895d33 100644
--- a/app/views/shared/issuable/_context.html.haml
+++ b/app/views/shared/issuable/_context.html.haml
@@ -8,7 +8,7 @@
- else
none
.issuable-context-selectbox
- - if can?(current_user, :set_assignee, @project)
+ - if can?(current_user, :admin_issue, @project)
= users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true)
%div.prepend-top-20.clearfix
@@ -24,7 +24,7 @@
- else
none
.issuable-context-selectbox
- - if can?(current_user, :set_milestone, @project)
+ - if can?(current_user, :admin_issue, @project)
= f.select(:milestone_id, milestone_options(issuable), { include_blank: 'Select milestone' }, {class: 'select2 select2-compact js-select2 js-milestone'})
= hidden_field_tag :issuable_context
= f.submit class: 'btn hide'
diff --git a/app/views/shared/issuable/_filter.html.haml b/app/views/shared/issuable/_filter.html.haml
index c03a34de446..a829782fc4f 100644
--- a/app/views/shared/issuable/_filter.html.haml
+++ b/app/views/shared/issuable/_filter.html.haml
@@ -29,11 +29,10 @@
.issues-details-filters
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name]), method: :get, class: 'filter-form' do
- - if controller.controller_name == 'issues'
+ - if controller.controller_name == 'issues' && can?(current_user, :admin_issue, @project)
.check-all-holder
= check_box_tag "check_all_issues", nil, false,
- class: "check_all_issues left",
- disabled: !can?(current_user, :modify_issue, @project)
+ class: "check_all_issues left"
.issues-other-filters
.filter-item.inline
= users_select_tag(:assignee_id, selected: params[:assignee_id],
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml
index 7095402bf05..e434e1b6b98 100644
--- a/app/views/shared/issuable/_form.html.haml
+++ b/app/views/shared/issuable/_form.html.haml
@@ -38,7 +38,7 @@
.clearfix
.error-alert
%hr
-- if can?(current_user, :set_assignee, @project)
+- if can?(current_user, :admin_issue, @project)
.form-group
.issue-assignee
= f.label :assignee_id, class: 'control-label' do
@@ -50,7 +50,6 @@
selected: issuable.assignee_id, project: @target_project || @project)
&nbsp;
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
-- if can?(current_user, :set_milestone, @project)
.form-group
.issue-milestone
= f.label :milestone_id, class: 'control-label' do
@@ -66,7 +65,6 @@
&nbsp;
- if can? current_user, :admin_milestone, issuable.project
= link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank
-- if can?(current_user, :set_label, @project)
.form-group
= f.label :label_ids, class: 'control-label' do
%i.fa.fa-tag