Defect #3392
closed
Account protection doesn't work
Added by Ondřej Kopr over 1 year ago.
Updated about 1 year ago.
Description
After project upgraded to version 13.0.x can exist more mapping for provisioning and same entity type.
This behavior brokes account protection because one of mapping can setup account protection, but after account delete isn't setup protection because in method missing check specific mapping:
DefaultSysSystemMappingService#getProtectionInterval
@Override
public Integer getProtectionInterval(AccAccountDto account) {
Assert.notNull(account, "Account cannot be null!");
Assert.notNull(account.getEntityType(), "EntityType cannot be null!");
SysSystemDto system = DtoUtils.getEmbedded(account, AccAccount_.system);
List<SysSystemMappingDto> mappings = this.findBySystem(system, SystemOperationType.PROVISIONING,
account.getEntityType());
if (mappings.isEmpty()) {
return -1;
}
// We assume only one mapping for provisioning and entity type.
return this.getProtectionInterval(mappings.get(0));
}
This is probably problem:
return this.getProtectionInterval(mappings.get(0));
- Status changed from New to In Progress
- Target version set to 13.0.6
- Status changed from In Progress to Needs feedback
- % Done changed from 0 to 80
- Assignee changed from Peter Štrunc to Ondřej Kopr
- Owner set to Peter Štrunc
- Status changed from Needs feedback to In Progress
Hi Peters i had morning wood from your fix, but after I tried, it was like my first time. It hurts!
The protection still doesn't work correctly. One part works correctly. But when I had two mappings for same object the protection can be activate for mapping that hasn't this feature setup.
There is also method: isEnabledProtection that must be updated:
public boolean isEnabledProtection(AccAccountDto account) {
Assert.notNull(account, "Account cannot be null!");
Assert.notNull(account.getEntityType(), "EntityType cannot be null!");
SysSystemDto system = DtoUtils.getEmbedded(account, AccAccount_.system);
List<SysSystemMappingDto> mappings = this.findBySystem(system, SystemOperationType.PROVISIONING,
account.getEntityType());
if (mappings.isEmpty()) {
return false;
}
// We assume only one mapping for provisioning and entity type.
return this.isEnabledProtection(mappings.get(0));
}
Could you just update this behavior?
I have patched the second method so that it won't hurt so much next time. Could you check it out again please?
- Status changed from In Progress to Needs feedback
- Status changed from Needs feedback to Resolved
- Assignee changed from Ondřej Kopr to Peter Štrunc
- % Done changed from 80 to 100
Oh my dear! Delicious juicy lucy. It looks awesome!
Thank you.
- Status changed from Resolved to Closed
Also available in: Atom
PDF