magpie.api.management.group.group_formats

Module Contents

Functions

format_group(group: Group, basic_info: bool = False, public_info: bool = False, db_session: Optional[Session] = None) → JSON

Obtains the JSON formatted group definition according to field selection flags.

magpie.api.management.group.group_formats.format_group(group: Group, basic_info: bool = False, public_info: bool = False, db_session: Optional[Session] = None) → JSON[source]

Obtains the JSON formatted group definition according to field selection flags.

Parameters
  • group – Group for which to provide details.

  • basic_info – If True, return only sufficient details to identify the group (useful for routes that refer to a group, but that are not requesting it specifically), or return full details (for routes that specifically request its information, e.g.: GET /groups/{grp}).

  • public_info – Indicate if the returned details are intended for public information (True) or admin-only (False). Only higher level users should be provided additional details to avoid leaking potentially sensitive parameters.

  • db_session – Database connection to retrieve additional details (required when public_info=False).