User Groups Management

class nc_py_api.users_groups._UsersGroupsAPI(session: NcSessionBasic)[source]

Class providing an API for managing user groups on the Nextcloud server.

Note

In NextcloudApp mode, only get_list and get_details methods are available.

get_list(mask: str | None = None, limit: int | None = None, offset: int | None = None) list[str][source]

Returns a list of user groups IDs.

get_details(mask: str | None = None, limit: int | None = None, offset: int | None = None) list[GroupDetails][source]

Returns a list of user groups with detailed information.

create(group_id: str, display_name: str | None = None) None[source]

Creates the users group.

edit(group_id: str, display_name: str) None[source]

Edits users group information.

delete(group_id: str) None[source]

Removes the users group.

get_members(group_id: str) list[str][source]

Returns a list of group users.

get_subadmins(group_id: str) list[str][source]

Returns list of users who is subadmins of the group.

class nc_py_api.users_groups.GroupDetails(raw_data: dict)[source]

User Group information.

property group_id: str

ID of the group.

property display_name: str

A display name of the group.

property user_count: int

Number of users in the group.

property disabled: bool

Flag indicating is group disabled.

property can_add: bool

Flag indicating the caller has enough rights to add users to this group.

property can_remove: bool

Flag indicating the caller has enough rights to remove users from this group.