|
|
@ -31,19 +31,11 @@ module OpenProject::Plugins |
|
|
|
@@disabled_modules = [] |
|
|
|
@@disabled_modules = [] |
|
|
|
|
|
|
|
|
|
|
|
class << self |
|
|
|
class << self |
|
|
|
def disable_modules(module_names) |
|
|
|
def disable_modules!(module_names) |
|
|
|
@@disabled_modules += Array(module_names).map(&:to_sym) |
|
|
|
@@disabled_modules += Array(module_names).map(&:to_sym).each do |module_name| |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def disable(disabled_modules) |
|
|
|
|
|
|
|
disabled_modules.map do |module_name| |
|
|
|
|
|
|
|
OpenProject::AccessControl.remove_modules_permissions(module_name) |
|
|
|
OpenProject::AccessControl.remove_modules_permissions(module_name) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
OpenProject::Application.config.to_prepare do |
|
|
|
|
|
|
|
OpenProject::Plugins::ModuleHandler.disable(@@disabled_modules) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|