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

Always run the synchronization service as the system user (#9278)

Oliver Günther5dca81b912a3
diff --git a/modules/ldap_groups/app/services/ldap_groups/synchronization_service.rb b/modules/ldap_groups/app/services/ldap_groups/synchronization_service.rb
index f9e712cddc1..0a2412b5f39 100644
--- a/modules/ldap_groups/app/services/ldap_groups/synchronization_service.rb
+++ b/modules/ldap_groups/app/services/ldap_groups/synchronization_service.rb
@@ -1,7 +1,9 @@
module LdapGroups
class SynchronizationService
def self.synchronize!
- new.call
+ User.system.run_given do
+ new.call
+ end
end
def call
diff --git a/modules/ldap_groups/app/workers/ldap_groups/synchronization_job.rb b/modules/ldap_groups/app/workers/ldap_groups/synchronization_job.rb
index c1beedf13a1..ece715133b8 100644
--- a/modules/ldap_groups/app/workers/ldap_groups/synchronization_job.rb
+++ b/modules/ldap_groups/app/workers/ldap_groups/synchronization_job.rb
@@ -37,9 +37,7 @@ module LdapGroups
return unless EnterpriseToken.allows_to?(:ldap_groups)
return if skipped?
- User.system.run_given do
- ::LdapGroups::SynchronizationService.synchronize!
- end
+ ::LdapGroups::SynchronizationService.synchronize!
end
def skipped?