多用户构建图(增加节点增加关系),在用户访问的时候只能访问自己创建的图谱,实体具有唯一标识(多用户可能创建同一个实体),在这种情况下如何做图谱的访问权限设定?
@graphway 使用JAVA实现扩展过程的时候allowed爆红,是为什么呢?(neo4j-v-3.4.9) 没有加allowed安装JAR之后,测试如上案例的时候出现报错:
Caused by: org.neo4j.driver.v1.exceptions.ClientException: Read operations are not allowed for user 'lockedDown' with roles [recommend_only].
哦,这种写法应该是3.1版本之前的。现在权限是在neo4j.conf里面设置、不用在过程里面指定allowed参数了。例子如下: dbms.security.procedures.roles=package.procedure1:roleName1,roleName2; package.procedure2:roleName1
@graphway neo4j.conf里面设置如下: dbms.security.procedures.roles=training.recommendOnly:recommend_only
出现的报错: Caused by: org.neo4j.driver.v1.exceptions.ClientException: Read operations are not allowed for user ‘lockedDown’ with roles [recommend_only]. at org.neo4j.driver.internal.net.SocketResponseHandler.handleFailureMessage(SocketResponseHandler.java:76)
另外浏览器登录时报错如下:
过程代码如下:
@Procedure(name = "training.recommendOnly", mode = Mode.READ)
@Description("Find recommender by an linkin account")
public Stream<Linkin> recommendOnly(@Name("name") String name) throws InvalidArgumentsException, IOException {
String query = "MATCH (n:LinkedinID {name: {name}}) RETURN n";
return db.execute(query, map("name", name))
.stream()
.map(Linkin::new);
}