Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Admin Policy Update #145

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions odins_spear/methods/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,28 @@ def group_admin(self, service_provider_id: str, group_id: str, user_id: str, pas
payload["password"] = password

return self.requester.post(endpoint, data=payload)


def group_admin_policies_bulk(self, user_ids: list, policy_config: dict):
"""Applies policy settings to multiple group administrators.

Note: See docs for formatting of parameters.

Args:
user_ids (list): User IDs of admins to apply policy to.
policy_config (dict): Policy settings to apply to target users.

Returns:
Dict: Returns admins and policy applied.
"""
endpoint = '/groups/admins/policies/bulk'

data = {
'users': [{'userId':user} for user in user_ids],
'data': policy_config
}

self.requester.post(endpoint, data=data)

#ADVICE OF CHARGE
#ALTERNATE NUMBERS
Expand Down
Loading