You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, there might be an account with an associated account. The person can see all details of their own account but not all details of the child accounts.
type User struct {
UserBasicInfo `groups:"basic"`
UserPrivateInfo `groups:"secret"`
Children []User `groups:"basic"`
}
type UserBasicInfo struct {
ID string
Email string
}
type UserPrivateInfo struct {
Secret string
}
Then as a parent I will see:
{
"ID": "43",
"Email": "[email protected]",
"Secret": "I cannot see my children's secrets. I only see my own secrets,",
"Children": [
{
"ID": "44",
"Email": "[email protected]"
}
]
}
But as a child I will see:
{
"ID": "44",
"Email": "[email protected]",
"Secret": "I see my own secret"
}
Currently this will not work because there are already groups on the User struct (the parent will see the child's secrets). Basically would just need a way to override the existing groups of nested groups.
Hi !
All in the title, it can be great to have an option to recursively apply groups on childs when the field is an Struct.
The text was updated successfully, but these errors were encountered: