Value integration tries to share unreadable topics and fails
In this example user "jri" tries to create a Note with title "Admin Note" and such a Title topic exists already in a workspace not readable by "jri". Value integration throws an access control exception and the Note is not created.
Jun 22, 2019 4:54:45 PM systems.dmx.core.util.UniversalExceptionMapper logException
SEVERE: Request "POST /core/topic" failed. Responding with 401 (Unauthorized). The original exception/error is:
java.lang.RuntimeException: Creating topic failed, model=TopicModelImpl {
"id": -1,
"uri": "",
"typeUri": "dmx.notes.note",
"value": "",
"children": {"dmx.notes.title": {
"id": -1,
"uri": "",
"typeUri": "dmx.notes.title",
"value": "Admin Note",
"children": {}
}}
}
at systems.dmx.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:133)
at systems.dmx.core.impl.CoreServiceImpl.createTopic(CoreServiceImpl.java:117)
at systems.dmx.core.impl.CoreServiceImpl.createTopic(CoreServiceImpl.java:31)
at systems.dmx.webservice.WebservicePlugin.createTopic(WebservicePlugin.java:117)
...
Caused by: java.lang.RuntimeException: Value integration failed, newValues=TopicModelImpl {
"id": -1,
"uri": "",
"typeUri": "dmx.notes.note",
"value": "",
"children": {"dmx.notes.title": {
"id": -1,
"uri": "",
"typeUri": "dmx.notes.title",
"value": "Admin Note",
"children": {}
}}
}, targetObject=null, compDef=null
at systems.dmx.core.impl.ValueIntegrator.integrate(ValueIntegrator.java:111)
at systems.dmx.core.impl.PersistenceLayer.updateValues(PersistenceLayer.java:892)
at systems.dmx.core.impl.PersistenceLayer.createTopic(PersistenceLayer.java:131)
... 54 more
Caused by: java.lang.RuntimeException: Value integration failed, newValues=RelatedTopicModelImpl {
"id": -1,
"uri": "",
"typeUri": "dmx.notes.title",
"value": "Admin Note",
"children": {}
}, targetObject=null, compDef=null
at systems.dmx.core.impl.ValueIntegrator.integrate(ValueIntegrator.java:111)
at systems.dmx.core.impl.ValueIntegrator.integrateChildValue(ValueIntegrator.java:278)
at systems.dmx.core.impl.ValueIntegrator.integrateComposite(ValueIntegrator.java:243)
at systems.dmx.core.impl.ValueIntegrator.integrate(ValueIntegrator.java:103)
... 56 more
Caused by: java.lang.RuntimeException: Fetching topic failed (key="dmx.notes.title", value="Admin Note")
at systems.dmx.core.impl.PersistenceLayer.getTopicByValue(PersistenceLayer.java:94)
at systems.dmx.core.impl.ValueIntegrator.unifySimple(ValueIntegrator.java:203)
at systems.dmx.core.impl.ValueIntegrator.integrateSimple(ValueIntegrator.java:171)
at systems.dmx.core.impl.ValueIntegrator.integrate(ValueIntegrator.java:102)
... 59 more
Caused by: systems.dmx.core.service.accesscontrol.AccessControlException: user "jri" has no READ permission for object 3984
at systems.dmx.accesscontrol.AccessControlPlugin.checkAccess(AccessControlPlugin.java:932)
at systems.dmx.accesscontrol.AccessControlPlugin.checkReadAccess(AccessControlPlugin.java:908)
at systems.dmx.accesscontrol.AccessControlPlugin.checkTopicReadAccess(AccessControlPlugin.java:519)
at systems.dmx.core.impl.CoreEvent$1.dispatch(CoreEvent.java:35)
at systems.dmx.core.impl.EventManager.dispatchEvent(EventManager.java:83)
at systems.dmx.core.impl.EventManager.fireEvent(EventManager.java:59)
at systems.dmx.core.impl.PersistenceLayer.checkTopicReadAccess(PersistenceLayer.java:786)
at systems.dmx.core.impl.TopicModelImpl.checkReadAccess(TopicModelImpl.java:129)
at systems.dmx.core.impl.PersistenceLayer.checkReadAccess(PersistenceLayer.java:776)
at systems.dmx.core.impl.PersistenceLayer.checkReadAccessAndInstantiate(PersistenceLayer.java:743)
at systems.dmx.core.impl.PersistenceLayer.getTopicByValue(PersistenceLayer.java:91)
... 62 more
Jun 22, 2019 4:54:45 PM systems.dmx.core.impl.TransactionFactory$TransactionResourceFilter$2 filter
WARNING: ### Rollback transaction of systems.dmx.webservice.WebservicePlugin#createTopic()
This is a more generic scenario than described in #238 (closed).
The envisioned solution is, when a topic exists (at DB layer) but is not readable (at access layer) the Value Integrator should not throw, but just return no result. As a consequence topics will be created redundantly at DB layer. #238 (closed) will be solved as well then.