Skip to content

Commit a60a2df

Browse files
authored
Merge pull request #29 from BnGx/master
Updated requirements file and enforcer function
2 parents 71c5907 + dcf8b20 commit a60a2df

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

flask_authz/casbin_enforcer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ def wrapper(*args, **kwargs):
7878
if self._owner_loader:
7979
self.app.logger.info("Get owner from owner_loader")
8080
for owner in self._owner_loader():
81+
owner = owner.strip('"') if isinstance(owner, str) else owner
8182
if self.e.enforce(
82-
owner.strip('"'), uri, request.method
83+
owner, uri, request.method
8384
):
8485
return func(*args, **kwargs)
8586
for header in map(str.lower, self.app.config.get("CASBIN_OWNER_HEADERS")):

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
casbin>=0.8.4
1+
casbin>=0.8.4,==1.0.4
22
click==7.1.2
33
flask==1.1.2
44
itsdangerous==1.1.0

0 commit comments

Comments
 (0)