Skip to content

Different @Expose rules for transforming to class or plain objects #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fatihky opened this issue May 8, 2019 · 2 comments · May be fixed by #1259
Closed

Different @Expose rules for transforming to class or plain objects #253

fatihky opened this issue May 8, 2019 · 2 comments · May be fixed by #1259
Labels
status: superset by another Issue or task being tracked/handled in a different issue. type: feature Issues related to new features.

Comments

@fatihky
Copy link

fatihky commented May 8, 2019

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
}
@NoNameProvided
Copy link
Member

Closing in favor of #378.

@NoNameProvided NoNameProvided added status: superset by another Issue or task being tracked/handled in a different issue. type: feature Issues related to new features. labels Jul 29, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: superset by another Issue or task being tracked/handled in a different issue. type: feature Issues related to new features.
Development

Successfully merging a pull request may close this issue.

2 participants