1

We've got a client who would like to be able to create "Child" user accounts, the idea being that someone could register and then create multiple child accounts that would inherit the settings of their parent account. It would also mean that any entries created by those child accounts would be visible, and editable, by the parent account.

My current, and only, idea would be to have Parent / Children user relations fields on the users that I would read to work out what I should be displaying to or letting the current user do, but I have a feeling that this might prove cumbersome to manage down the line and messy to code at least the way I code.

Is there a clean way of doing this, or perhaps a plugin that does this already (I've looked but couldn't find anything). I'm also open to writing a plugin that would do this, I just don't really know where to start.

This will all be happening front-end, so no need to touch the control panel in any way.

1

The only way to do what you're describing out-of-the-box is by adding a user field for Users. Then you can either check that field for child users or get a little creative with relatedTo to get parent users.

If you want to, for example, prevent a child user being linked to several parents or you want the same field to display the parent (if any), you're looking at a custom field type implemented by a plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.