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 b041441 commit fd03cb9
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -43,13 +43,8 @@
import com.orientechnologies.orient.core.sql.OCommandSQL;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.core.storage.OStorageProxy;
import com.orientechnologies.orient.core.Orient;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;

/**
@@ -321,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;
}

0 comments on commit fd03cb9

Please sign in to comment.