use of eu.bcvsolutions.idm.acc.entity.SysSyncActionLog in project CzechIdMng by bcvsolutions.
the class DefaultSysSyncActionLogService method save.
@Override
public SysSyncActionLogDto save(SysSyncActionLogDto dto, BasePermission... permission) {
Assert.notNull(dto);
//
if (!ObjectUtils.isEmpty(permission)) {
SysSyncActionLog persistEntity = null;
if (dto.getId() != null) {
persistEntity = this.getEntity(dto.getId());
if (persistEntity != null) {
// check access on previous entity - update is needed
checkAccess(persistEntity, IdmBasePermission.UPDATE);
}
}
// TODO: remove one checkAccess?
checkAccess(toEntity(dto, persistEntity), permission);
}
//
// save
SysSyncActionLogDto newDto = saveInternal(dto);
// iterate over all log items
for (SysSyncItemLogDto item : dto.getLogItems()) {
item.setSyncActionLog(newDto.getId());
item = syncItemLogService.save(item);
newDto.addLogItems(item);
}
return newDto;
}
Aggregations