Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OUser.hasRole() does not work correctly in case of child ORole class #8338

Closed
PhantomYdn opened this issue Jun 17, 2018 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@PhantomYdn
Copy link
Contributor

OrientDB Version: 2.2.30, 3.0.3

There is such line in code: https://github.com/orientechnologies/orientdb/blob/develop/core/src/main/java/com/orientechnologies/orient/core/metadata/security/OSecurityShared.java#L319

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

    return null;
  }

As you can see, there is explicit check for className - it should be equal ORole. But if you extend ORole and use for your project child class: it will lead to bug when hasRole doesn't work.

@luigidellaquila luigidellaquila self-assigned this Jun 18, 2018
@luigidellaquila
Copy link
Member

Hi @PhantomYdn

Thank you for reporting, I'm fixing it now

Thanks

Luigi

@luigidellaquila
Copy link
Member

Hi @PhantomYdn

I just pushed a fix, now it should be OK.
The fix will be released with v 2.2.37 and v 3.0.3

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.3 milestone Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants