replaced relation_type_name with circuit_type_name
find recursive into multidimension array
added user roles and permissions