Fixing iteration in PermissionRepository and using array_map instead