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

add owner loader #15

Merged
merged 2 commits into from Nov 9, 2020
Merged

add owner loader #15

merged 2 commits into from Nov 9, 2020

Conversation

zazayaya
Copy link

@zazayaya zazayaya commented Nov 6, 2020

add owner loader decorator

example:

from flask_login import current_user

@casbin_enforcer.owner_loader
def owner():
    return [u.name for u in current_user.roles]

@hsluoyz
Copy link
Member

hsluoyz commented Nov 6, 2020

@techoner @jessecooper @yyellowsun please review.

@jessecooper
Copy link
Collaborator

@zazayaya would it be possible to write some unit tests around this code?

@zazayaya
Copy link
Author

zazayaya commented Nov 9, 2020

@zazayaya would it be possible to write some unit tests around this code?

@jessecooper i have added owner loader unit tests, please review.

@jessecooper
Copy link
Collaborator

@zazayaya Thanks for adding the unit tests LGTM.

@jessecooper jessecooper merged commit 440488e into pycasbin:master Nov 9, 2020
@jessecooper
Copy link
Collaborator

I will create and upload a new release to pypi as soon as possible.

@zazayaya
Copy link
Author

I will create and upload a new release to pypi as soon as possible.

Thanks!!!

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

Successfully merging this pull request may close these issues.

None yet

3 participants