Patch #3461 » redmine-1.0.4-issue-assignment-permission.patch
| app/models/issue.rb | ||
|---|---|---|
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
# Comments by akb
|
||
|
# ToDo: check against permission_manage_issue_assignment
|
||
|
class Issue < ActiveRecord::Base
|
||
|
belongs_to :project
|
||
|
belongs_to :tracker
|
||
| app/models/query.rb | ||
|---|---|---|
|
label ||= field.gsub(/\_id$/, "")
|
||
|
end
|
||
|
# @arnekolja
|
||
|
# Total rewrite to reject not allowed column. Only last line is still the same.
|
||
|
def available_columns
|
||
|
return @available_columns if @available_columns
|
||
|
@available_columns = Query.available_columns
|
||
|
@available_columns = (@available_columns) ? @available_columns : Query.available_columns
|
||
|
@available_columns.reject! {|c| c.name == :assigned_to} unless User.current.allowed_to?(:view_issue_assignment, @project)
|
||
|
|
||
|
@available_columns += (project ?
|
||
|
project.all_issue_custom_fields :
|
||
|
IssueCustomField.find(:all)
|
||
| app/views/issues/_attributes.rhtml | ||
|---|---|---|
|
<% end %>
|
||
|
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %></p>
|
||
|
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
|
||
|
<% if User.current.allowed_to?(:manage_issue_assignment, @project) -%>
|
||
|
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
|
||
|
<% else %>
|
||
|
<% if User.current.allowed_to?(:view_issue_assignment, @project) -%>
|
||
|
<p><label><%=l(:field_assigned_to)%></label><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></p>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
<% unless @project.issue_categories.empty? %>
|
||
|
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
|
||
|
<%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'),
|
||
| app/views/issues/show.rhtml | ||
|---|---|---|
|
<th class="due-date"><%=l(:field_due_date)%>:</th><td class="due-date"><%= format_date(@issue.due_date) %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th class="assigned-to"><%=l(:field_assigned_to)%>:</th><td class="assigned-to"><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
|
||
|
<% if User.current.allowed_to?(:view_issue_assignment, @project) -%>
|
||
|
<th class="assigned-to"><%=l(:field_assigned_to)%>:</th><td class="assigned-to"><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
|
||
|
<% end %>
|
||
|
<th class="progress"><%=l(:field_done_ratio)%>:</th><td class="progress"><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
| lib/redmine.rb | ||
|---|---|---|
|
map.permission :add_issues, {:issues => [:new, :create, :update_form]}
|
||
|
map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new]}
|
||
|
map.permission :manage_issue_relations, {:issue_relations => [:new, :destroy]}
|
||
|
map.permission :manage_issue_assignment, {} # @arnekolja
|
||
|
map.permission :view_issue_assignment, {} # @arnekolja
|
||
|
map.permission :manage_subtasks, {}
|
||
|
map.permission :add_issue_notes, {:issues => [:edit, :update], :journals => [:new]}
|
||
|
map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin
|
||