(domain_link, master_results)
Mutates the master result docs to convert dynamic report permissions.
Mutates the master result docs to convert dynamic report permissions.
Mutates the master result docs to convert dynamic report permissions .
def _convert_reports_permissions(domain_link, master_results):
    """Mutates the master result docs to convert dynamic report permissions.
    """
    report_map = get_static_report_mapping(domain_link.master_domain, domain_link.linked_domain)
    report_map.update({
        c.report_meta.master_id: c._id
        for c in get_report_configs_for_domain(domain_link.linked_domain)
    })

    for role_def in master_results:
        new_report_perms = [
            perm for perm in role_def['permissions']['view_report_list']
            if 'DynamicReport' not in perm
        ]

        for master_id, linked_id in report_map.items():
            master_report_perm = get_ucr_class_name(master_id)
            if master_report_perm in role_def['permissions']['view_report_list']:
                new_report_perms.append(get_ucr_class_name(linked_id))

        role_def['permissions']['view_report_list'] = new_report_perms
def _convert_reports_permissions ( domain_link , master_results ) : report_map = get_static_report_mapping ( domain_link . master_domain , domain_link . linked_domain ) report_map . update ( { c . report_meta . master_id : c . _id for c in get_report_configs_for_domain ( domain_link . linked_domain ) } ) for role_def in master_results : new_report_perms = [ perm for perm in role_def [ 'permissions' ] [ 'view_report_list' ] if 'DynamicReport' not in perm ] for master_id , linked_id in report_map . items ( ) : master_report_perm = get_ucr_class_name ( master_id ) if master_report_perm in role_def [ 'permissions' ] [ 'view_report_list' ] : new_report_perms . append ( get_ucr_class_name ( linked_id ) ) role_def [ 'permissions' ] [ 'view_report_list' ] = new_report_perms