From 61bcdb01bc50fdbb9c77d06979fecc7541226f7e Mon Sep 17 00:00:00 2001 From: Juhan Oskar Hennoste Date: Sun, 18 Aug 2024 20:42:48 +0300 Subject: [PATCH] Add support for role parameter in NamesRolesProvisioningService --- pylti1p3/names_roles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pylti1p3/names_roles.py b/pylti1p3/names_roles.py index 136cc86..f88a647 100644 --- a/pylti1p3/names_roles.py +++ b/pylti1p3/names_roles.py @@ -67,7 +67,7 @@ def get_members_page( data_body = t.cast(t.Any, data.get("body", {})) return data_body.get("members", []), data["next_page_url"] - def get_members(self, resource_link_id: t.Optional[str] = None) -> t.List[TMember]: + def get_members(self, resource_link_id: t.Optional[str] = None, role: t.Optional[str] = None) -> t.List[TMember]: """ Get list with all users. @@ -79,6 +79,9 @@ def get_members(self, resource_link_id: t.Optional[str] = None) -> t.List[TMembe if members_url and resource_link_id: members_url = add_param_to_url(members_url, "rlid", resource_link_id) + + if members_url and role: + members_url = add_param_to_url(members_url, "role", role) while members_url: members, members_url = self.get_members_page(members_url)