Defect #3267
closedRole assignment on imported user in created state leads to server error
100%
Description
role assignment on imported user in created state leads to server error 500
Mar 6 14:44:06 test.olda.tld czechidm1144: 2023-03-06 14:44:06.009 ERROR 3160150 --- [http-nio-8080-exec-6] eu.bcvsolutions.idm.core.exception.ExceptionControllerAdvice.log : [core:INTERNAL_SERVER_ERROR:5c74605c-2ffc-4f2a-9e07-f862facf45dd] Contract is required. ({})
Mar 6 14:44:06 test.olda.tld czechidm1144: java.lang.IllegalArgumentException: Contract is required.
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.util.Assert.notNull(Assert.java:198)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRequestIdentityRoleService.save(DefaultIdmRequestIdentityRoleService.java:195)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRequestIdentityRoleService.save(DefaultIdmRequestIdentityRoleService.java:64)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRequestIdentityRoleService$$FastClassBySpringCGLIB$$f31c770b.invoke(<generated>)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:752)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.model.service.impl.DefaultIdmRequestIdentityRoleService$$EnhancerBySpringCGLIB$$8e84dbda.save(<generated>)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.api.rest.AbstractReadWriteDtoController.saveDto(AbstractReadWriteDtoController.java:96)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.api.rest.AbstractReadWriteDtoController.postDto(AbstractReadWriteDtoController.java:124)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.api.rest.AbstractReadWriteDtoController.post(AbstractReadWriteDtoController.java:110)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.rest.impl.IdmRequestIdentityRoleController.post(IdmRequestIdentityRoleController.java:144)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.rest.impl.IdmRequestIdentityRoleController$$FastClassBySpringCGLIB$$b12cf269.invoke(<generated>)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:752)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at eu.bcvsolutions.idm.core.rest.impl.IdmRequestIdentityRoleController$$EnhancerBySpringCGLIB$$d37e281a.post(<generated>)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Mar 6 14:44:06 test.olda.tld czechidm1144: #011at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
Updated by Tomáš Doischer almost 2 years ago
That behaves as expected as roles are assigned to a contract. Identities in the CREATED state do not have a contract.
Updated by Tomáš Doischer almost 2 years ago
- Subject changed from role assignment on imported user in created state leads to server error to Role assignment on imported user in created state leads to server error
- Assignee set to Boris Polák
- Target version set to 13.1.0
After consultation with Oldřich, this should be improved.
When a user is created (or simply without a contract) and you navigate to their full detail > Roles, you are unable to create a new role request for them.
However, on the user's dashboard, the button to assign role to a user is still visible and you can create a new role request. The new request will be created without belonging to a contract or an account. After submitting the request, it will fail.
The concept role request detail shouldn't let you save the concept if there is no owner of the role assignment (contract, account) selected.
Ideally, we should also hide the dashboard button in those cases (or perhaps make it inactive with an explanation on hover).
Updated by Boris Polák over 1 year ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Boris Polák to Peter Štrunc
- % Done changed from 0 to 80
Updated by Tomáš Doischer over 1 year ago
- Status changed from Needs feedback to Resolved
- Assignee changed from Peter Štrunc to Boris Polák
- Target version changed from 13.1.0 to 13.0.3
- % Done changed from 80 to 100
Nice, thank you. Merged to develop.
Updated by Tomáš Doischer over 1 year ago
- Status changed from Resolved to Closed