OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Move udpate and destroy of shares into the WP scope
Klaus Zanders8f2599640a5d
diff --git a/app/controllers/work_packages/shares_controller.rb b/app/controllers/work_packages/shares_controller.rbindex c539a718568..930f2fc8dfc 100644--- a/app/controllers/work_packages/shares_controller.rb+++ b/app/controllers/work_packages/shares_controller.rb@@ -30,7 +30,7 @@ class WorkPackages::SharesController < ApplicationControllerinclude OpTurbo::ComponentStreaminclude MemberHelper- before_action :find_work_package, only: %i[index create resend_invite]+ before_action :find_work_package, only: %i[index create destroy update resend_invite]before_action :find_share, only: %i[destroy update resend_invite]before_action :find_projectbefore_action :authorize@@ -200,8 +200,7 @@ class WorkPackages::SharesController < ApplicationControllerenddef find_share- @share = Member.of_any_work_package.find(params[:id])- @work_package = @share.entity+ @share = @work_package.members.find(params[:id])enddef find_sharesdiff --git a/config/routes.rb b/config/routes.rbindex 2c8206aceff..b5626b227e3 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -517,8 +517,6 @@ Rails.application.routes.draw do# FIXME: this is kind of evil!! We need to remove this soonest and# cover the functionality. Route is being used in work-package-service.js:331get "/bulk" => "bulk#destroy"-- resources :shares, only: %i[destroy update]endresources :work_packages, only: [:index] do@@ -532,7 +530,7 @@ Rails.application.routes.draw doget "details/*state" => "work_packages#index", on: :collection, as: :details# Rails managed sharing route- resources :shares, controller: "work_packages/shares", only: %i[index create] do+ resources :shares, controller: "work_packages/shares", only: %i[index create update destroy] domember dopost "resend_invite" => "work_packages/shares#resend_invite"end