Hi. I have a scenario that appears to me as a poor fit for Realm sync, but I’d appreciate the thoughts and advice of others in case I’ve overlooked something.
Here is the scenario, simplified as best I can:
Logical entities
Site->Job->Job details(outputs logged to each worker) + workers/users etc
4 Roles
Employee-Admin (read/write access to all jobs and work details - creates jobs and assigns staff)
Employee-Senior (read/write access to assigned jobs)
Employee-Junior (read access to just the work details they performed)
Site Manager (external to org - read access to all work details for each job performed at their site)
Additional info
Data entry during a job could be messy. A senior employee could add job details for themselves and 3 junior employees, whilst an employee with the admin role could add job details for themselves plus a junior employee. Jobs may only last a few days before the workers move to another site. They rotate through sites, meaning the concept of a site is sufficiently independent of a job, and many sites have no internet availability where the work is conducted and data entry performed.
From what I’ve learnt of Realm sync so far, it would seem that client-side filtering may be easiest for internal staff (where cross-role security might not be much of an issue and there are very few data writers), whereas external staff might need a different Realm App using a different partition key, or a duplicated set of records with a partition value set just for them. As these sound like nasty compromises I’m hoping someone has better ideas than me as to how to tackle this scenario.