Defect #1263
closedAutomatic role by attribute "workPosition" doesn't work
100%
Description
Version: current develop (9.1.1.-SNAPSHOT)
Automatic role for contract attribute "workPosition" doesn't work - the role isn't assigned to users. The LRT, which should add the role, fails with the following exception:
java.lang.ClassCastException: Cannot cast java.lang.String to eu.bcvsolutions.idm.core.model.entity.IdmTreeNode at java.lang.Class.cast(Class.java:3369) at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmAutomaticRoleAttributeService.castToType(DefaultIdmAutomaticRoleAttributeService.java:708) at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmAutomaticRoleAttributeService.getPredicateForRuleByContract(DefaultIdmAutomaticRoleAttributeService.java:502)
Use-case:
We want to assign the role automatically by organization and at the same time an EAV of identity. So we need one of the automatic rules: contract.workPosition = 123456 where 123456 is the code of the organization.
So far we can use workaround - set the code of the organization to a new EAV of contract.
Related issues
Updated by Radek Tomiška about 6 years ago
- Assignee changed from Ondřej Kopr to Radek Tomiška
Automatic role by attribute "workPosition" is not implemented. Automatic roles by tree nodes can be used for this purpose.
I'll remove unimplemented field "workPosition" from automatic roles by attribute (the same as ''guarantees'' in #1145) for now. Then we can discuss about, if it is needed to implement it (UC above cannot be solved by automatic roles by tree nodes it self)
Updated by Alena Peterová about 6 years ago
Radek Tomiška wrote:
Automatic role by attribute "workPosition" is not implemented. Automatic roles by tree nodes can be used for this purpose.
I'll remove unimplemented field "workPosition" from automatic roles by attribute (the same as ''guarantees'' in #1145)
OK, please remove it for now. I will create a new ticket - feature request - for our use case (combination of automatic roles by organization and by attribute - we need it on 2 projects already).
Updated by Alena Peterová about 6 years ago
- Related to Feature #1265: Support automatic roles by organization and by attributes added
Updated by Radek Tomiška about 6 years ago
- Status changed from New to Needs feedback
- Assignee changed from Radek Tomiška to Ondřej Kopr
- Target version set to Morganite (9.2.0)
- % Done changed from 0 to 90
I removed field "workPosition" from automatic roles by attribute.
Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/f2acbd331880f0ffd143094f086446a48af19382
Could you do a feedback, pls?
Updated by Ondřej Kopr about 6 years ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Ondřej Kopr to Radek Tomiška
- % Done changed from 90 to 100
Thank you for remove workPosition, now isn't possible pick this attribute by frontend.
Updated by Radek Tomiška about 6 years ago
- Status changed from Resolved to Closed