Closed
Description
I want to allow only some groups to be able to set a property's value and different groups to see that property's value. When I use two @Expose()
calls on the same property, first @Expose()
call gets ignored.
Here is an example:
class User {
// Determine who can set email property's value
@Expose({
groups: ['register', 'admin'], // email can only be set on register and can only be updated by the admin
toClassOnly: true
}) // second call
// Determine who can see email of user instances.
@Expose({
toPlainOnly: true // I want everyone to be able to see email.
}) // first call
email: string
}