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

coreEnforcer.buildRoleLinksInternal calls model.buildRoleLinks(rmMap) on values of rmMap #331

Open
richard-sim opened this issue Nov 3, 2021 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@richard-sim
Copy link

await this.model.buildRoleLinks(this.rmMap);

Due to a refactor ~6 months ago, model.buildRoleLinks(rmMap) is called within a loop over rmMap.values() in coreEnforcer.buildRoleLinksInternal(). Not only is this inefficient, but if rmMap is empty then model.buildRoleLinks() will never be called.

@casbin-bot
Copy link
Member

@casbin-bot casbin-bot added the question Further information is requested label Nov 3, 2021
@Shivansh-yadav13
Copy link
Member

@richard-sim do you have any suggestions on how it can be improved?

@hsluoyz
Copy link
Member

hsluoyz commented Mar 6, 2022

@fabian4 @nodece

@richard-sim
Copy link
Author

@Shivansh-yadav13: It's been a while since I opened this issue, but IIRC it should not be in the loop at all (as it was prior to the refactor that I referred to).

@Shivansh-yadav13
Copy link
Member

Not only is this inefficient, but if rmMap is empty then model.buildRoleLinks() will never be called.

but we will have Default Role Manager? if we use role definition in the model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

4 participants