onCreate.identityType = role不是第一个

时间:2016-10-12 12:36:29

标签: orientdb orientdb-2.1 orientdb2.2

我使用v.2.2.11 我使用onCreate.identityType时出现问题。 文档说:

onCreate.identityType: Specifies whether to insert the user's object or its role (the first one). By default, it is set to user, but you can also set it to use its role.

但事实并非如此,我已经拥有一个具有多个角色的用户,并在ORestricted类中插入一条新记录。 我在这里做了什么:

  • 创建新的数据库
  • create class test extends ORestricted
  • ALTER CLASS test CUSTOM`onCreate.identityType` = role
  • 插入ouser set name =' test',password =' test',status =' ACTIVE',roles =(从orole中选择名称在[ '读取器''作家'])
  • 使用测试用户登录
  • 插入测试集now = sysdate()(x 10次)

随便_allow字段包含#4:1或#4:2

这是一个错误吗? 如果没有,是否有任何使其成功的建议,如文档中所述?

1 个答案:

答案 0 :(得分:0)

我转载了你的“问题”,我认为文档是指第一个对象或角色,而不是第一个角色是两个角色。不需要同时使用reader和writer角色,因为writer也可以执行读操作。如果您只想要读者角色,可以使用

insert into ouser set name='test',password='test',status='ACTIVE',roles=(select from orole where name in ['reader'])