user3841223
user3841223

Reputation: 61

onCreate.identityType=role not the first one

I'm using v. 2.2.11 I've got a problem using onCreate.identityType. The documentation says:

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.

But it's not true, I've got a user with multiple roles and inserting a new record into a ORestricted class it takes randomly on of them. Here what I did:

Casually _allow field contains #4:1 or #4:2

Is it a bug? If not, any suggestion for making it work like written in the documentation?

Upvotes: 1

Views: 27

Answers (1)

Oleksandr Gubchenko
Oleksandr Gubchenko

Reputation: 1369

I reproduced your "issue", I think documentation refers to first object or role, and not first role of two roles. There is no need to use both reader and writer roles, since writer also can do read operations. If you want only reader role you can just use

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

Upvotes: 0

Related Questions