Add user email in user filtering + type
MODIFY
src/server/rest/service/security/CarSecurity.ts
src/server/rest/service/security/CarSecurity.ts
@@ -241,8 +241,6 @@ export default class CarSecurity {
filteredCar.carCatalog = forList ? this.filterMinimalCarCatalogResponse(car.carCatalog, loggedUser) :
this.filterCarCatalogResponse(car.carCatalog, loggedUser);
}
- // Remove unused props
- delete filteredCar.usersCar;
return filteredCar;
}

MODIFY
src/server/rest/service/security/UserSecurity.ts
src/server/rest/service/security/UserSecurity.ts
@@ -166,7 +166,7 @@ export default class UserSecurity {
// User
static filterMinimalUserResponse(user: User, loggedUser: UserToken): User {
- const filteredUser: any = {};
+ const filteredUser = {} as User;
if (!user) {
return null;
}
@@ -177,10 +177,12 @@ export default class UserSecurity {
filteredUser.id = null;
filteredUser.name = Constants.ANONYMIZED_VALUE;
filteredUser.firstName = Constants.ANONYMIZED_VALUE;
+ filteredUser.email = Constants.ANONYMIZED_VALUE;
} else {
filteredUser.id = user.id;
filteredUser.name = user.name;
filteredUser.firstName = user.firstName;
+ filteredUser.email = user.email;
}
}
return filteredUser;

Add user email in user filtering + type