Write or token create operations are not allowed in procedure using cypher projection

一个人想着一个人 提交于 2019-12-24 04:19:24

问题


When calling a procedure using an evaluated inner query (cypher projection)which would be creating an node or edge a forbidden error is thrown for the admin user. It is possible to run the query outside the procedure.

Maybe it is something of an configuration issue?

I am trying to run a query using the timetree procedure of GraphAware and the LabelPropagation of Neo4j. But I've been able to get the forbidden error using a much simpler query. I am using Neo4j Desktop. I have tried giving the admin all the possible roles.

For example

call apoc.cypher.run("create (n:Test) return n",{}) yield value return *

Or another example:

CALL algo.labelPropagation.stream(
    'CALL ga.timetree.events.range({start: 1480896000000, end: 1520294400000}) YIELD node RETURN id(node) AS id',
    'MATCH (c1:Case)-[r:NARROWER_THAN]->(c2:Case) RETURN id(c1) AS source, id(c2) as target, r.score AS weight', 
    { graph:'cypher'}
)YIELD nodeId, label
with label as lpa, collect(nodeId) as ids, count(nodeId) as c  
where c > 2
return lpa, c, ids  
order by c desc

These are the errors for the first and second example:

Neo.ClientError.Security.Forbidden: Token create operations are not allowed for user 'neo4j' with roles [admin,architect,editor,publisher,reader] restricted to READ.

Neo.ClientError.Security.Forbidden: Write operations are not allowed for user 'neo4j' with roles [admin,architect,editor,publisher,reader] restricted to READ.


回答1:


The procedure apoc.cypher.run can only execute read queries. Creating/updating/deleting nodes is not allowed with it.



来源:https://stackoverflow.com/questions/56786881/write-or-token-create-operations-are-not-allowed-in-procedure-using-cypher-proje

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!