Skip to content

Commit

Permalink
fix OUser.getRole() on hierarchy of role classes
Browse files Browse the repository at this point in the history
Resolves: #8338
  • Loading branch information
luigidellaquila committed Jun 18, 2018
1 parent ba7463c commit 2130ca8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ public boolean dropUser(final String iUserName) {

public ORole getRole(final OIdentifiable iRole) {
final ODocument doc = iRole.getRecord();
if (doc != null && "ORole".equals(doc.getClassName()))
return new ORole(doc);
if (doc != null) {
OClass clazz = doc.getSchemaClass();
if (clazz != null && clazz.isSubClassOf("ORole")) {
return new ORole(doc);
}
}

return null;
}
Expand Down

0 comments on commit 2130ca8

Please sign in to comment.