[{'modules': [{'module_id': 1, 'module_name': 'ModuleOne', 'permissions': [
    {'can_create': True, 'can_delete': True, 'can_read': True, 'can_update':
    True, 'end_point_id': 1, 'end_point_name': 'entity'}, {'can_create':
    True, 'can_delete': True, 'can_read': True, 'can_update': True,
    'end_point_id': 2, 'end_point_name': 'management-type'}, {'can_create':
    True, 'can_delete': False, 'can_read': True, 'can_update': True,
    'end_point_id': 3, 'end_point_name': 'ownership-type'}]}, {'module_id':
    2, 'module_name': 'ModuleTwo', 'permissions': [{'can_create': True,
    'can_delete': True, 'can_read': True, 'can_update': True,
    'end_point_id': 4, 'end_point_name': 'financial-outlay'}, {'can_create':
    True, 'can_delete': True, 'can_read': True, 'can_update': True,
    'end_point_id': 5, 'end_point_name': 'exposure'}]}], 'role_id': 1}]
Сортировка и группировка списка словарей