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

Create a user with Java with lowest rights in OrientDB

我通过以下方式创建了一个最低权限的用户:

            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)。但那会扼杀整个数据库结构和功能!

那么如何进一步限制权限呢?这真的很糟糕,因为我想让任何人都可以访问数据库。但是没有人应该能够改变刚刚阅读的任何内容......必须有办法......

按照上面的方法好像可以。这只是一个错误或针对特定用户的临时更改,不会进一步损害数据库。所以代码完全没问题。