@@ -116,7 +116,6 class IssuesController < ApplicationController | |||||
116 |
|
116 | |||
117 | @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } |
|
117 | @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
118 | @allowed_statuses = @issue.new_statuses_allowed_to(User.current) |
|
118 | @allowed_statuses = @issue.new_statuses_allowed_to(User.current) | |
119 | @edit_allowed = User.current.allowed_to?(:edit_issues, @project) |
|
|||
120 | @priorities = IssuePriority.active |
|
119 | @priorities = IssuePriority.active | |
121 | @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) |
|
120 | @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) | |
122 | @relation = IssueRelation.new |
|
121 | @relation = IssueRelation.new | |
@@ -393,7 +392,6 class IssuesController < ApplicationController | |||||
393 | # from the params |
|
392 | # from the params | |
394 | # TODO: Refactor, not everything in here is needed by #edit |
|
393 | # TODO: Refactor, not everything in here is needed by #edit | |
395 | def update_issue_from_params |
|
394 | def update_issue_from_params | |
396 | @edit_allowed = User.current.allowed_to?(:edit_issues, @project) |
|
|||
397 | @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) |
|
395 | @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) | |
398 | if params[:time_entry] |
|
396 | if params[:time_entry] | |
399 | @time_entry.attributes = params[:time_entry] |
|
397 | @time_entry.attributes = params[:time_entry] |
@@ -153,7 +153,12 class Issue < ActiveRecord::Base | |||||
153 |
|
153 | |||
154 | # Returns true if user or current user is allowed to edit or add a note to the issue |
|
154 | # Returns true if user or current user is allowed to edit or add a note to the issue | |
155 | def editable?(user=User.current) |
|
155 | def editable?(user=User.current) | |
156 |
user |
|
156 | attributes_editable?(user) || user.allowed_to?(:add_issue_notes, project) | |
|
157 | end | |||
|
158 | ||||
|
159 | # Returns true if user or current user is allowed to edit the issue | |||
|
160 | def attributes_editable?(user=User.current) | |||
|
161 | user.allowed_to?(:edit_issues, project) | |||
157 | end |
|
162 | end | |
158 |
|
163 | |||
159 | def initialize(attributes=nil, *args) |
|
164 | def initialize(attributes=nil, *args) |
@@ -2,7 +2,7 | |||||
2 | <%= error_messages_for 'issue', 'time_entry' %> |
|
2 | <%= error_messages_for 'issue', 'time_entry' %> | |
3 | <%= render :partial => 'conflict' if @conflict %> |
|
3 | <%= render :partial => 'conflict' if @conflict %> | |
4 | <div class="box"> |
|
4 | <div class="box"> | |
5 |
<% if @ |
|
5 | <% if @issue.attributes_editable? %> | |
6 | <fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend> |
|
6 | <fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend> | |
7 | <div id="all_attributes"> |
|
7 | <div id="all_attributes"> | |
8 | <%= render :partial => 'form', :locals => {:f => f} %> |
|
8 | <%= render :partial => 'form', :locals => {:f => f} %> |
General Comments 0
You need to be logged in to leave comments.
Login now