mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Prevent stripping of permissions before disabled modules registered
The +remove_modules_permissions+ is called before the disabled modules are registered. https://community.openproject.org/wp/43213
This commit is contained in:
@@ -26,9 +26,10 @@
|
||||
# See COPYRIGHT and LICENSE files for more details.
|
||||
#++
|
||||
|
||||
Rails.application.config.after_initialize do
|
||||
Rails.application.config.to_prepare do
|
||||
if OpenProject::Configuration.disabled_modules.any?
|
||||
to_disable = OpenProject::Configuration.disabled_modules
|
||||
OpenProject::Plugins::ModuleHandler.disable_modules(to_disable)
|
||||
OpenProject::Plugins::ModuleHandler.enforce!
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,15 +35,11 @@ module OpenProject::Plugins
|
||||
@@disabled_modules += Array(module_names).map(&:to_sym)
|
||||
end
|
||||
|
||||
def disable(disabled_modules)
|
||||
disabled_modules.map do |module_name|
|
||||
def enforce!
|
||||
@@disabled_modules.map do |module_name|
|
||||
OpenProject::AccessControl.remove_modules_permissions(module_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
OpenProject::Application.config.to_prepare do
|
||||
OpenProject::Plugins::ModuleHandler.disable(@@disabled_modules)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user