magpie.api.management.group.group_utils

Module Contents

magpie.api.management.group.group_utils.get_all_group_names(db_session) → List[Str][source]

Get all existing group names from the database.

magpie.api.management.group.group_utils.get_group_resources(group, db_session) → JSON[source]

Get formatted JSON body describing all service resources the group as permissions on.

magpie.api.management.group.group_utils.create_group(group_name, db_session) → HTTPException[source]

Creates a group if it is permitted and not conflicting.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.
magpie.api.management.group.group_utils.create_group_resource_permission_response(group, resource, permission, db_session) → HTTPException[source]

Creates a permission on a group/resource combination if it is permitted and not conflicting.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.
magpie.api.management.group.group_utils.get_group_resources_permissions_dict(group, db_session, resource_ids=None, resource_types=None) → JSON[source]

Get a dictionary of resources and corresponding permissions that a group has on the resources.

Filter search by resource_ids and/or resource_types if specified.

magpie.api.management.group.group_utils.get_group_resource_permissions_response(group, resource, db_session) → HTTPException[source]

Get validated response with group resource permissions as content.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.
magpie.api.management.group.group_utils.delete_group_resource_permission_response(group, resource, permission, db_session) → HTTPException[source]

Get validated response on deleted group resource permission.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.
magpie.api.management.group.group_utils.get_group_services(resources_permissions_dict, db_session) → JSON[source]

Nest and regroup the resource permissions under corresponding root service types.

magpie.api.management.group.group_utils.get_group_services_response(group, db_session) → HTTPException[source]

Get validated response of services the group has permissions on.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.
magpie.api.management.group.group_utils.get_group_service_permissions(group, service, db_session) → List[Permission][source]

Get all permissions the group has on a specific service.

magpie.api.management.group.group_utils.get_group_service_permissions_response(group, service, db_session) → HTTPException[source]

Get validated response of found group service permissions.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.
magpie.api.management.group.group_utils.get_group_service_resources_permissions_dict(group, service, db_session) → JSON[source]

Get all permissions the group has on a specific service’s children resources.

magpie.api.management.group.group_utils.get_group_service_resources_response(group, service, db_session) → HTTPException[source]

Get validated response of all found service resources which the group has permissions on.

Returns:valid HTTP response on successful operations.
Raises:HTTPException – error HTTP response of corresponding situation.