Project

General

Profile

Actions

Task #3129

closed

The EavCodeContractByManagerFilter returns subordinates from expired contracts

Added by Tomáš Doischer almost 2 years ago. Updated about 1 year ago.

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

100%

Estimated time:
Owner:

Description

Currently, this can be done for managers (added in #2002). The same needs to be done for subordinates.


Related issues

Related to IdStory Identity Manager - Task #2002: Managers of contracts ended in the past shouldn't be able to change roles for currect contractClosedRadek Tomiška01/06/2020

Actions
Related to IdStory Identity Manager - Task #3259: Release 12.2.5ClosedTomáš Doischer02/28/2023

Actions
Related to IdStory Identity Manager - Defect #3230: Direct managers can partially see inactive subordinates, configuration to allow/disable option to see inactive subordinates In ProgressJan Potočiar11/24/2022

Actions
Actions #1

Updated by Tomáš Doischer almost 2 years ago

  • Related to Task #2002: Managers of contracts ended in the past shouldn't be able to change roles for currect contract added
Actions #2

Updated by Tomáš Doischer over 1 year ago

  • Sprint set to Sprint 12.3-4 (zář 14 - zář 28)
Actions #3

Updated by Tomáš Doischer over 1 year ago

  • Status changed from New to In Progress

I tested this and it works for manually assigned contract guarantees by default. If user A is a manager of an expired contract of user B, user B will not be listed among user A's subordinates.

Actions #4

Updated by Tomáš Doischer over 1 year ago

This seems to work correctly with managers by tree structure with the default filter as well.

Actions #5

Updated by Tomáš Doischer over 1 year ago

I asked the customer for more details, I cannot replicate the issue in my local devenv or the customer's environment.

Actions #6

Updated by Tomáš Doischer over 1 year ago

  • Subject changed from Add the option to show subordinates from only valid contracts to The EavCodeContractByManagerFilter returns subordinates from expired contracts
  • % Done changed from 0 to 40

I updated the title.

After much testing, I found that filters for subordinates do not return subordinates if their contract was expired. No change is needed there. The UC is this:

  1. have a tree node T and a tree node U where the tree node T is the parent of tree node U
  2. have a user with contract C which is valid and is in position T and contract D which is expired and is in position U
  3. contract D has a manager (the same as the owner of the contract) - this is correct since the filter can be parametrized to prevent this
  4. the user should have no subordinates because the only potential candidate (the user themselves) has the relevant contract expired

That's how subordinate filters work in general. However, point 4 does not work this way for EavCodeContractByManagerFilter (this filter has different ways of expressing tree node hierarchy, of course).

I checked the generated SQLs and found there is a mistake in the predicate which needs to be fixed.

Actions #7

Updated by Tomáš Doischer over 1 year ago

  • % Done changed from 40 to 70
Actions #8

Updated by Tomáš Doischer over 1 year ago

  • Assignee changed from Tomáš Doischer to Roman Kučera
  • % Done changed from 70 to 80

Tests passed.

@kucerar, can you give me feedback?

As for testing, you need to have this config:

idm.sec.core.filter.IdmIdentity.managersFor.impl=eavCodeManagersFilter
idm.sec.core.filter.IdmIdentity.managersFor.formAttribute=super
idm.sec.core.filter.IdmIdentity.managersFor.formDefinition=default
idm.sec.core.filter.IdmIdentity.managersFor.persistentType=shortTextValue
idm.sec.core.filter.IdmIdentityContract.subordinatesFor.impl=eav-code-contract-by-manager-filter
idm.sec.core.filter.IdmIdentityContract.subordinatesFor.formDefinition=default
idm.sec.core.filter.IdmIdentityContract.subordinatesFor.formAttribute=super
idm.sec.core.filter.IdmIdentityContract.subordinatesFor.persistentType=shortTextValue

Have two tree nodes, create a short text EAV attribute called "super". The tree nodes don't need to be parents of each other (the structure can be flat) but the subordinate tree should have in the EAV attribute the code of the superior tree. After that, you can follow notes from #3129#note-6. If you have any questions, please let me know. I also have the SQLs from generated by Hibernate based on the predicates before and after the change if you want to see them.

Actions #9

Updated by Tomáš Doischer over 1 year ago

  • Status changed from In Progress to Needs feedback
Actions #10

Updated by Roman Kučera over 1 year ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Roman Kučera to Tomáš Doischer
  • % Done changed from 80 to 100

thx for detailed info how to test it :) , it works. Merged.

Actions #11

Updated by Tomáš Doischer about 1 year ago

  • Status changed from Resolved to Closed
Actions #12

Updated by Tomáš Doischer about 1 year ago

Actions #13

Updated by Tomáš Doischer about 1 year ago

  • Related to Defect #3230: Direct managers can partially see inactive subordinates, configuration to allow/disable option to see inactive subordinates added
Actions

Also available in: Atom PDF