在OrientDB中创建具有最低权限的Java用户

我通过以下方式创建具有最低权限的用户:

db.command(new OCommandScript("sql", "insert into orole set name = 'ardaRole', mode = 0")).execute(); db.command(new OCommandScript("sql", "update orole put rules = 'database.class', 2 where name = 'ardaRole'")).execute(); db.command(new OCommandScript("sql", "update orole put rules = 'database.function', 2 where name = 'ardaRole'")).execute(); db.command(new OCommandScript("sql", "update orole put rules = 'database.cluster', 2 where name = 'ardaRole'")).execute(); db.command(new OCommandScript("sql", "insert into ouser set name = 'arda', password = 'arda', status = 'ACTIVE', roles = (select from ORole where name = 'ardaRole')")) .execute(); 

这非常有效。 如果您想查看我项目中的权限,请查看: http : //arda-maps.org:2480 with arda arda

所以我的问题是这些权利仍然允许更改顶点名称之类的内容 (所以我将LOVES更改为LOVESd)。 但那就是杀死整个数据库结构和function!

那么我怎样才能进一步限制权利呢? 这真的很糟糕,因为我想让任何人都可以访问数据库。 但是没有人应该能够改变那些只读过的东西……必须有办法……

它似乎在上面的方式工作。 这只是特定用户的错误或临时更改,并且不会进一步损害数据库。 所以代码完全没问题。