magpie.api.management.resource.resource_formats¶
Module Contents¶
-
magpie.api.management.resource.resource_formats.format_resource(resource, permissions=None, basic_info=False)[source]¶ Formats the
resourceinformation into JSON.
-
magpie.api.management.resource.resource_formats.format_resource_tree(children, db_session, resources_perms_dict=None, internal_svc_res_perm_dict=None)[source]¶ Generates the formatted service/resource tree with all its children resources by calling :function:`format_resource` recursively.
Filters resource permissions with
resources_perms_dictif provided.Parameters: - children – service or resource for which to generate the formatted resource tree
- db_session – connection to db
- resources_perms_dict – any pre-established user- or group-specific permissions. Only those are shown if given.
- internal_svc_res_perm_dict – for this function’s use only, avoid re-fetch of already obtained permissions for corresponding resources
Returns: formatted resource tree