Removes :delete_work_packages

pull/442/head
Hagen Schink 11 years ago
parent dc00910385
commit 4899367d8c
  1. 2
      app/views/api/v2/projects/_project.api.rsb
  2. 14
      features/planning_elements/planning_element_management.feature.disabled
  3. 3
      features/timelines/timeline_view_with_reporters.feature
  4. 26
      features/timelines/timeline_wiki_macro.feature
  5. 13
      lib/redmine.rb
  6. 2
      spec/controllers/api/v2/planning_elements_controller_spec.rb

@ -34,7 +34,7 @@ api.project do
api.permissions(
:view_planning_elements => User.current.allowed_to?(:view_work_packages, project),
:edit_planning_elements => User.current.allowed_to?(:edit_work_packages, project),
:delete_planning_elements => User.current.allowed_to?(:delete_planning_elements, project)
:delete_planning_elements => User.current.allowed_to?(:delete_work_packages, project)
)
# TODO: Evaluate html formatting of description instead of passing the raw

@ -30,13 +30,13 @@ Feature: Planning Element Management
And there is a role "manager"
And the role "manager" may have the following rights:
| view_timelines |
| view_planning_elements |
| edit_work_packages |
| delete_planning_elements |
| view_work_packages |
| edit_work_packages |
| add_work_packages |
| view_timelines |
| view_planning_elements |
| edit_work_packages |
| delete_work_packages |
| view_work_packages |
| edit_work_packages |
| add_work_packages |
And there is a project named "ecookbook" of type "Standard Project"
And I am working in project "ecookbook"

@ -59,9 +59,8 @@ Feature: Timeline View Tests with reporters
| view_timelines |
| edit_timelines |
| view_work_packages |
| delete_planning_elements |
| edit_work_packages |
| delete_planning_elements |
| delete_work_packages |
| view_reportings |
| view_project_associations |

@ -52,21 +52,21 @@ Feature: Timeline Wiki Macro
And there is a role "god"
And the role "god" may have the following rights:
| manage_wiki |
| view_wiki_pages |
| edit_wiki_pages |
| view_work_packages |
| edit_work_packages |
| delete_planning_elements |
| view_timelines |
| manage_wiki |
| view_wiki_pages |
| edit_wiki_pages |
| view_work_packages |
| edit_work_packages |
| delete_work_packages |
| view_timelines |
And there is a role "loser"
And the role "loser" may have the following rights:
| manage_wiki |
| view_wiki_pages |
| edit_wiki_pages |
| view_work_packages |
| edit_work_packages |
| delete_planning_elements |
| manage_wiki |
| view_wiki_pages |
| edit_wiki_pages |
| view_work_packages |
| edit_work_packages |
| delete_work_packages |
And there is a project named "ecookbook" of type "Standard Project"
And the following types are enabled for projects of type "Standard Project"

@ -116,7 +116,12 @@ Redmine::AccessControl.map do |map|
map.permission :edit_work_package_notes, {:journals => [:edit, :update]}, :require => :loggedin
map.permission :edit_own_work_package_notes, {:journals => [:edit, :update]}, :require => :loggedin
map.permission :delete_work_packages, {:issues => :destroy,
:work_packages => :destroy}, :require => :member
:work_packages => :destroy,
:planning_elements => [:confirm_destroy,
:destroy,
:destroy_all,
:confirm_destroy_all]},
:require => :member
map.permission :manage_work_package_relations, {:work_package_relations => [:create, :destroy]}
map.permission :manage_subtasks, {}
# Queries
@ -204,12 +209,6 @@ Redmine::AccessControl.map do |map|
{:timelines => [:confirm_destroy, :destroy]},
{:require => :member}
map.permission :delete_planning_elements,
{:planning_elements => [:confirm_destroy, :destroy,
:destroy_all,
:confirm_destroy_all]},
{:require => :member}
map.permission :view_reportings,
{:reportings => [:index, :all, :show]}
map.permission :edit_reportings,

@ -83,7 +83,7 @@ describe Api::V2::PlanningElementsController do
let(:current_user) { FactoryGirl.create(:user) }
before do
role = FactoryGirl.create(:role, :permissions => [:delete_planning_elements])
role = FactoryGirl.create(:role, :permissions => [:delete_work_packages])
projects = block ? instance_eval(&block) : [project]

Loading…
Cancel
Save