From 0c0bec4e6668fcc44e6c25c654c4d7402027c803 Mon Sep 17 00:00:00 2001 From: andres Date: Wed, 23 Sep 2020 12:57:16 +0200 Subject: [PATCH] Added get_realm_roles_of_user --- keycloak/keycloak_admin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index ae443b6..36c3cb8 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -1015,6 +1015,11 @@ class KeycloakAdmin: data=json.dumps(payload)) return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) + def get_realm_roles_of_user(self, user_id): + params_path = {"realm-name": self.realm_name, "id": user_id} + data_raw = self.raw_get(URL_ADMIN_USER_REALM_ROLES.format(**params_path)) + return raise_error_from_response(data_raw, KeycloakGetError) + def assign_group_realm_roles(self, group_id, roles): """ Assign realm roles to a group