Skip to content

Commit dcf8b20

Browse files
committed
The CasbinEnforcer.enforcer function receives any type from the CasbinEnforcer._owner_loader callback.
1 parent 2448f2f commit dcf8b20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flask_authz/casbin_enforcer.py

Lines changed: 2 additions & 1 deletion
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")):

0 commit comments

Comments
 (0)