Merge branch 'RED-7094' into 'master'
PMD fix Closes RED-7094 See merge request redactmanager/persistence-service!44
This commit is contained in:
commit
bbd705cdb1
@ -25,20 +25,17 @@ public class SyncUserPermissionsJob implements Job {
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
public void execute(JobExecutionContext context) {
|
||||
|
||||
var singleTenant = context.getJobDetail().getJobDataMap() != null ? context.getJobDetail().getJobDataMap().get("tenantId") : null;
|
||||
tenantProvider.getTenants().forEach(tenant -> {
|
||||
if(isTenantReadyForPersistence(tenant)) {
|
||||
// if it's for a single tenant run only for that one, else run it for all tenants
|
||||
if (tenant.getTenantId().equals(singleTenant) || singleTenant == null) {
|
||||
TenantContext.setTenantId(tenant.getTenantId());
|
||||
customPermissionService.syncAllCustomPermissions();
|
||||
TenantContext.clear();
|
||||
}
|
||||
// if it's for a single tenant run only for that one, else run it for all tenants
|
||||
if (isTenantReadyForPersistence(tenant) && (tenant.getTenantId().equals(singleTenant) || singleTenant == null)) {
|
||||
TenantContext.setTenantId(tenant.getTenantId());
|
||||
customPermissionService.syncAllCustomPermissions();
|
||||
TenantContext.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user