Skip to content
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

Expose / Exclude based on its ‘parent’ relationship in One to Many #723

Closed
hsb1007 opened this issue Feb 17, 2019 · 0 comments
Closed

Comments

@hsb1007
Copy link

hsb1007 commented Feb 17, 2019

@geotas thank you for your quick response but i believe it is still not answered fully

I have a social Post / Comment entity and its User entity (creator of the post) in OneToMany relation ship.

Depending on the Post privacy setting, I want to control what user detail gets return.

I have checked

Exclude/Expose with if expression but could not access to its parent entity in relation (Post / Comment)

Preserialize Event - For some reason, it doesn't event get called at the moment and unsure whether I can set 'Dynamic' Groups for User entity on 'Preserialize' event.

Custom Exclusion Policy - Still unsure how I can access to Post / Comment from User

Does anyone have any idea?

I am serialising ‘Post’ and user needs to have different fields return. In its Exclude and Expose, i dont get to reference to the specific Post i am serialising if it makes sense.

I cannot do things like getPost from user as user has many Posts..

I am scratching my head for hours..

@hsb1007 hsb1007 closed this as completed Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant