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

load_policy changed the old model #273

Closed
GHNSL opened this issue Oct 22, 2022 · 2 comments · Fixed by #277
Closed

load_policy changed the old model #273

GHNSL opened this issue Oct 22, 2022 · 2 comments · Fixed by #277
Assignees
Labels
question Further information is requested

Comments

@GHNSL
Copy link

GHNSL commented Oct 22, 2022

in core_enforcer.py
def load_policy(self):
"""reloads the policy from file/database."""
need_to_rebuild = False
new_model = copy.copy(self.model)
new_model.clear_policy()

new_model.clear_policy() will change the policy in self.model, becourse it's a shallow copy

@casbin-bot
Copy link
Member

@techoner @Nekotoxin

@casbin-bot casbin-bot added the question Further information is requested label Oct 22, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Oct 22, 2022

@leeqvip @Xhy-5000

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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants