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/447/head v2.16.3
Raspreet Singh 2 years ago
committed by GitHub
parent
commit
bd9168a88d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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