Group
- class Group(api)
Bases:
_IdentityBase
- add_members(group, members)
- Parameters
group (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the group.
members (List[Union[ident.Identity, str]]) – List of Identity Object or Prefixed Name of each member.
- Returns
List of Identity Object for each member.
- create(name, members=None, get_if_already_exists=True)
- Parameters
name (str) – Name of the user. The local: prefix is not required.
members (List[Union[ident.Identity, ident.Identity, str]]) – List of Identity Object or Prefixed Name of each member.
get_if_already_exists (bool) – If the identity already exists, just return it as is.
- Returns
Identity Object of the group.
- delete(group)
Deletes a group, but not its members. All group permissions and privileges are deleted.
- Parameters
group (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the group.
- exists(prefixed_name)
- Parameters
prefixed_name (str) – The Prefixed Name of the identity.
- Returns
True
if the identity exists, otherwiseFalse
.- Return type
bool
- find(name, limit=100, is_distribution_group=False, is_security_group=True)
Finds groups within the the Identity Providers to which the authenticated user has view permissions.
- Parameters
name (str) – String of characters contained within the names to be found.
limit (int) – Maximum number of results to return.
is_distribution_group (bool) – If
True
, results include AD Distribution Groups.is_security_group (bool) – If
True
, results include Local and AD/LDAP groups.
- Returns
List of Identity Object for each group found.
- get(prefixed_name=None, prefixed_universal=None, raise_error_if_not_exists=True)
One of
prefixed_name
orprefixed_universal
must be provided.- Parameters
prefixed_name (str) – The Prefixed Name of the identity object.
prefixed_universal (str) – The prefixed universal of the identity object.
raise_error_if_not_exists (bool) – Raise an exception if the identity does not exist.
- Returns
- get_members(group, resolve_nested=False)
- Parameters
group (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the group.
resolve_nested (bool) – If
True
, recursively returns members of groups within this group.
- Returns
List of Identity Object for each member of the group.
- get_memberships(identity)
- Parameters
identity (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the identity.
- Returns
List of Identity Object for each group.
- read_attribute(identity, attribute_name)
- Parameters
identity (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the identity.
attribute_name (str) – The name of the attribute.
- Returns
List of attribute values.
- Return type
List[str]
- remove_members(group, members)
Removes members from a local group.
- Parameters
group (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the group.
members (List[Union[ident.Identity, str]]) – List of Identity Object or Prefixed Name of each member.
- Returns
List of Identity Object for each remaining member. If no members remain, then the list is empty.
- rename(group, new_group_name)
Renames a local group. The local: prefix is not required.
- Parameters
group (Union[ident.Identity, str]) – Identity Object or Prefixed Name of the group.
new_group_name (str) – New name of the group. No prefix required.
- Returns
Identity Object with the new group name.