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

[Bug] unable to extend Casbin with custom role manager #1107

Closed
ghost opened this issue Sep 16, 2022 · 2 comments · Fixed by #1141
Closed

[Bug] unable to extend Casbin with custom role manager #1107

ghost opened this issue Sep 16, 2022 · 2 comments · Fixed by #1141
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Sep 16, 2022

Want to prioritize this issue? Try:

issuehunt-to-marktext


Describe the bug

The are several parts in the code where instead of calling the objects through the interface the object is being cast to a specific implementation.

Places where you can find the issue:

To Reproduce
Steps to reproduce the behavior:

  1. Create an enforcer
  2. Set the role manager with your custom implementation
  3. Execute any function that goes through any of the above like GetNamedImplicitPermissionsForUser
  4. See error: interface conversion: rbac.RoleManager is *autz.RoleManager, not *defaultrolemanager.RoleManager

Expected behavior

The function should be called through the interface

Desktop (please complete the following information):

  • OS: macOS 12.6
  • Casbin Version github.com/casbin/casbin/v2 v2.54.0
@ghost ghost added the bug label Sep 16, 2022
@ghost ghost assigned hsluoyz Sep 16, 2022
@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang

@JalinWang
Copy link
Member

Thanks! Disentanglement definitely should be done. I'll try to make the interface more general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants