Browse Source

fix: Fixes `Authorization.load_config` breaking if a scope based permission is linked with anything other than a role based policy. Fixes #445 (#446)

pull/430/head
Raspreet Singh 1 year ago
committed by elias.hamacher
parent
commit
b5e19043f5
  1. 3
      src/keycloak/authorization/__init__.py

3
src/keycloak/authorization/__init__.py

@ -88,7 +88,8 @@ class Authorization:
if "applyPolicies" in pol["config"]:
for policy_name in ast.literal_eval(pol["config"]["applyPolicies"]):
self.policies[policy_name].add_permission(permission)
if self.policies.get(policy_name) is not None:
self.policies[policy_name].add_permission(permission)
if pol["type"] == "resource":
permission = Permission(

Loading…
Cancel
Save