Hi guys!
I think I found a strange behaviuor using remote connection with Java API.

If I take the current connected user (for example admin) and want to know 
its roles, the collection contains just a "dummy" role: passthrough
OUser 
user=(ODatabaseRecordTx)ODatabaseRecordThreadLocal.INSTANCE.get().getUser();
Set<ORole> roles=user.getRoles();

roles contains ["passthrough"] instead of ["admin"]

I have inspected the code and I have found that the "magic" happens in 
ODatabaseRecordAbstract.open() at line 161:
 // REMOTE CREATE DUMMY USER
 user = new OUser(iUserName, 
OUser.encryptPassword(iUserPassword)).addRole(new ORole("passthrough", null,
            ORole.ALLOW_MODES.ALLOW_ALL_BUT));

I don't know why you made this, but in this way the behaviour of the API 
changes between local and remote connection.
Because the result of OUser.getRoles() changes and can not be predictable 
but depends on connection type.

However, via Java API, is there a short way to get the "real" roles 
avoiding a select statement?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to