diff --git a/flask_authz/casbin_enforcer.py b/flask_authz/casbin_enforcer.py index 99e234b..0386ca3 100644 --- a/flask_authz/casbin_enforcer.py +++ b/flask_authz/casbin_enforcer.py @@ -22,14 +22,14 @@ def __init__(self, app=None, adapter=None, watcher=None): app (object): Flask App object to get Casbin Model adapter (object): Casbin Adapter """ - self.app = None + self.app = app self.adapter = adapter self.e = None self.watcher = watcher self._owner_loader = None self.user_name_headers = None - if app: - self.init_app(app) + if self.app is not None: + self.init_app(self.app) def init_app(self, app): self.app = app