PMD fix #44
@ -25,20 +25,17 @@ public class SyncUserPermissionsJob implements Job {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@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;
|
var singleTenant = context.getJobDetail().getJobDataMap() != null ? context.getJobDetail().getJobDataMap().get("tenantId") : null;
|
||||||
tenantProvider.getTenants().forEach(tenant -> {
|
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 it's for a single tenant run only for that one, else run it for all tenants
|
||||||
if (tenant.getTenantId().equals(singleTenant) || singleTenant == null) {
|
if (isTenantReadyForPersistence(tenant) && (tenant.getTenantId().equals(singleTenant) || singleTenant == null)) {
|
||||||
TenantContext.setTenantId(tenant.getTenantId());
|
TenantContext.setTenantId(tenant.getTenantId());
|
||||||
customPermissionService.syncAllCustomPermissions();
|
customPermissionService.syncAllCustomPermissions();
|
||||||
TenantContext.clear();
|
TenantContext.clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user