使用密码投影的过程中不允许进行写或令牌创建操作

时间:2019-06-27 08:22:34

标签: neo4j cypher neo4j-apoc

使用已评估的内部查询(cypher projection)调用过程时,该内部查询将创建节点或边,将为管理员用户抛出禁止的错误。可以在过程外运行查询。

也许这是配置问题?

我正在尝试使用GraphAware的时间树过程和Neo4j的LabelPropagation运行查询。但是我已经能够使用更简单的查询来获取禁止的错误。我正在使用Neo4j Desktop。我尝试赋予管理员所有可能的角色。

例如

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

或者另一个例子:

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

这些是第一个和第二个示例的错误:

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 个答案:

答案 0 :(得分:1)

过程apoc.cypher.run只能执行读取查询。不允许创建/更新/删除节点。