プロジェクト

全般

プロフィール

Vote #77968

完了

Project field disappears when target project disallows user to edit the project

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
123
issue_org_id:
24311
author_id:
159776
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
122
ステータス-->[Closed]

説明

h1. Issue

Editing the Project Field in an Issue reloads the form

On Reloading / Rendering the project field is excluded if the user is not allowed to change the @project_id@ for issues in that project

The field disappears when the user clicks on a project where changing the project field is not allowed

The issue cannot be moved to the other project by that user, however: The list of target projects is calculated by the right to create issues in that project. This means that there is a mismatch.

h1. Goal

The project field should not disappear on selection of a project, either by showing the field more often (lax approach) or reducing the target projects list.

h1. Suggestion

My suggestion for the lax approach is:


# app/views/issues/_form.html.erb
- <% if @issue.safe_attribute?('project_id') && (!@issue.new_record? || @project.nil? || @issue.copy?) %>
+ <% if (@issue.safe_attribute?('project_id') || @issue.allowed_target_projects.include?(@issue.project_id) ) && (!@issue.new_record? || @project.nil? || @issue.copy?) %>
  

<%= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true}, :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)" %>

<% end %>

journals

--------------------------------------------------------------------------------
Fixed in r15959 using a slightly different solution and tests added.
Thanks for pointing this out.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョン3.3.2_123 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0