Skip to content

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

apply access control to projects#deactivate_work_package_attachments

ulfertsf9849ae830e5
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index d1168ae7e5f..a23acff93c7 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -32,7 +32,7 @@ class ProjectsController < ApplicationController
before_action :find_project, except: %i[index new]
before_action :load_query_or_deny_access, only: %i[index]
- before_action :authorize, only: %i[copy]
+ before_action :authorize, only: %i[copy deactivate_work_package_attachments]
before_action :authorize_global, only: %i[new]
before_action :require_admin, only: %i[destroy destroy_info]
diff --git a/config/initializers/permissions.rb b/config/initializers/permissions.rb
index 4b3e6ae5d73..0f474ddcbb9 100644
--- a/config/initializers/permissions.rb
+++ b/config/initializers/permissions.rb
@@ -95,6 +95,7 @@ Rails.application.reloader.to_prepare do
{
"projects/settings/general": %i[show],
"projects/settings/storage": %i[show],
+ projects: %i[deactivate_work_package_attachments],
"projects/templated": %i[create destroy],
"projects/identifier": %i[show update]
},