Project

General

Profile

Actions

Defect #3046

closed

Remove last rule for automatic roles break referential integrity

Added by Ondřej Kopr about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Tomáš Doischer
Category:
Automatic roles
Target version:
Start date:
01/31/2022
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

Use case:
  • Administrator removes last rule by editing automatic roles by attribute,
  • the automatic role itself still exists but without rules,
  • the recalcutaion porcess ends with error result:
    java.lang.IllegalArgumentException: Pageable must not be null!
        at org.springframework.util.Assert.notNull(Assert.java:198)
        at org.springframework.data.domain.Chunk.<init>(Chunk.java:54)
        at org.springframework.data.domain.PageImpl.<init>(PageImpl.java:46)
        at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmAutomaticRoleAttributeService.getContractsForAutomaticRole(DefaultIdmAutomaticRoleAttributeService.java:336)
    

There is little diference between LTS version and 11.x because on LTS version process still removes all roles from user and only recalculation ended with error. But in version 11 (customer environment) ends the task with broken referential integrity. And we must fixed the issue with database queries.

When we create automatic roles is required at least one rule, so solution is probably very easy - just disallows remove last rule from whole automatic role.

Actions #1

Updated by Peter Štrunc about 2 years ago

  • Target version set to 12.2.0
Actions #2

Updated by Tomáš Doischer about 2 years ago

  • Status changed from New to In Progress
  • Assignee changed from Peter Štrunc to Tomáš Doischer
Actions #3

Updated by Tomáš Doischer about 2 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Tomáš Doischer to Roman Kučera
  • % Done changed from 0 to 90

Implemented as suggested (I think this was originally intended but it did not work this way in update). I rewrote the conditions to cover every use-case.

I added tests, this code was not covered by tests previously (requests were started internally only).

Commit: https://github.com/bcvsolutions/CzechIdMng/pull/175

@kucerar, can you please give me feedback?

Actions #4

Updated by Tomáš Doischer about 2 years ago

  • Sprint set to Sprint 12.2-1 (úno 18 - bře 02)
Actions #5

Updated by Roman Kučera about 2 years ago

  • Status changed from Needs feedback to Resolved
  • % Done changed from 90 to 100

Looks good, merged into develop

Actions #6

Updated by Roman Kučera about 2 years ago

  • Assignee changed from Roman Kučera to Tomáš Doischer
Actions #7

Updated by Roman Kučera almost 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF