From eb8916bc87bda341844162fa13a97489eb7bff40 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 12 Jan 2023 02:59:54 +0000 Subject: Introduce permission to set a project public (#38048). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Felix Schäfer. git-svn-id: https://svn.redmine.org/redmine/trunk@22038 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- ...21214173537_add_select_project_publicity_permission.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 db/migrate/20221214173537_add_select_project_publicity_permission.rb (limited to 'db') diff --git a/db/migrate/20221214173537_add_select_project_publicity_permission.rb b/db/migrate/20221214173537_add_select_project_publicity_permission.rb new file mode 100644 index 000000000..9b3db0cdc --- /dev/null +++ b/db/migrate/20221214173537_add_select_project_publicity_permission.rb @@ -0,0 +1,15 @@ +class AddSelectProjectPublicityPermission < ActiveRecord::Migration[5.2] + def up + Role.find_each do |r| + r.add_permission!(:select_project_publicity) if r.permissions.include?(:edit_project) + end + end + + def down + Role.find_each do |r| + r.remove_permission!(:select_project_publicity) + end + end + + def run_in_request?; true end +end -- cgit v1.2.3