Commit d315d1eb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Dont allow guest to set assigne, milestone and label when create new issue or merge request

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 60baa1e8
...@@ -154,6 +154,9 @@ class Ability ...@@ -154,6 +154,9 @@ class Ability
project_guest_rules + [ project_guest_rules + [
:download_code, :download_code,
:fork_project, :fork_project,
:set_assignee,
:set_milestone,
:set_label,
:write_project_snippet :write_project_snippet
] ]
end end
......
...@@ -37,8 +37,9 @@ ...@@ -37,8 +37,9 @@
.clearfix .clearfix
.error-alert .error-alert
%hr %hr
.form-group - if can?(current_user, :set_assignee, @project)
.form-group
.issue-assignee .issue-assignee
= f.label :assignee_id, class: 'control-label' do = f.label :assignee_id, class: 'control-label' do
%i.fa.fa-user %i.fa.fa-user
...@@ -49,7 +50,8 @@ ...@@ -49,7 +50,8 @@
selected: issuable.assignee_id, project: @target_project || @project) selected: issuable.assignee_id, project: @target_project || @project)
&nbsp; &nbsp;
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link' = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
.form-group - if can?(current_user, :set_milestone, @project)
.form-group
.issue-milestone .issue-milestone
= f.label :milestone_id, class: 'control-label' do = f.label :milestone_id, class: 'control-label' do
%i.fa.fa-clock-o %i.fa.fa-clock-o
...@@ -64,7 +66,8 @@ ...@@ -64,7 +66,8 @@
&nbsp; &nbsp;
- if can? current_user, :admin_milestone, issuable.project - 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 = link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank
.form-group - if can?(current_user, :set_label, @project)
.form-group
= f.label :label_ids, class: 'control-label' do = f.label :label_ids, class: 'control-label' do
%i.fa.fa-tag %i.fa.fa-tag
Labels Labels
......
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