Hello,
I'm building a REI3 application for a family daycare network in Switzerland. Our organisation places children with home-based childcare providers (about 70 active providers, 600 families). The application manages child records, parents, providers, and above all the placement agreements with weekly childcare schedules (regular or irregular).
What I'm trying to achieve
Currently, recording and approving childcare hours happens on paper or by email. I'd like to give direct access to the application:
- Each parent: view their own children's agreements, approve declared childcare hours, update their contact details
- Each provider: enter actual hours for the children in their care, report absences and time off Coordination staff: full management (already in place)
Data isolation is essential: a parent must see only data concerning their own children. I plan to use policies on the parents, enfants (children) and conventions (agreements) relations, with a user_id field on the parent record compared against instance.get_user_id().
Where I'm stuck
My schema includes a parents relation. When our secretary creates a new parent record in the application, I'd like the corresponding user account to be created automatically (login = email address, temporary password, parent role), with parents.user_id populated.
I've explored several approaches:
Backend function with instance.* — The list of available functions contains nothing for creating an account (get_user_id, get_role_ids, has_role, user_meta_set, user_sync_all, but no user_create or equivalent).
Direct access to system tables — The relation selector in the Builder only offers my own application modules. System tables don't appear to be accessible from a placeholder.
instance.rest_call() — Technically usable from an AFTER INSERT trigger, but I don't know whether an administration API exists that would allow account creation. I found nothing in the documentation.
user_sync function — I've configured a function on the module (called whenever an account is created or updated). It works in the opposite direction: when an account is created manually in the admin UI, the function finds the matching parent record by email and populates user_id. Useful, but it assumes someone creates the account by hand.
My questions
- Is there any way to create a user account from a backend function or trigger? An undocumented function, an administration REST API, or another approach?
- Can account creation be delegated to a non-administrator user? Our secretary needs to create access for new families without full instance administration rights. Is there a granular permission for this?
- Does bulk account import exist in the admin UI? A CSV import combined with user_sync would be an acceptable compromise: the secretary creates records in the application, and a periodic import generates the accounts.
- How do you handle end-of-life for accounts? When a placement ends, I want to cut off access but keep the historical data (legal retention requirement). Is there an "inactive" status on accounts, or should the role simply be removed? With family turnover, I'll reach several thousand accounts over fifteen years — I'd like to avoid the admin list becoming unmanageable.
- More broadly: does this use case — many external users with isolated access to their own data — match what REI3 is designed for? If this isn't the product's direction, I'd rather know now than build something fragile.
One last note on context: our network isn't the only one of its kind in the canton. About a dozen comparable organisations currently work with a patchwork of tools, often spreadsheets and paper. If this application works out, I intend to present it to the other networks — since their structure and needs are very close to ours, it would be directly reusable. That's part of why I'd rather ask these questions now than build a fragile workaround.
Thank you very much for your help and for this excellent tool.