Thanks Sam, that clears thing up a bit. In that case, to summarise
I'll go with something like this (someone please chip in if this is
blatantly wrong and sorry about the long post):
{
users: [
{ id: 'user1', email: 'bill[at]
companyone.com' },
{ id: 'user2', email: 'ben[at]
companytwo.com' }
],
accounts: [
{
id: 'account1', name: 'Company One', owner_id: 'user1',
sites: [
{ id: 'site1', subdomain: 'company-one-first-site',
editor_ids: ['user1'] },
{ id: 'site2', subdomain: 'company-one-second-site',
editor_ids: ['user1', 'user2'] },
]
},
{
id: 'account2', name: 'Company Two', owner_id: 'user2' ,
sites: [
{ id: 'site3', subdomain: 'company-twos-only-site',
editor_ids: ['user2'] }
]
}
],
pages: [
{ id: 'page1', title: 'Homepage one', site_id: 'site1' },
{ id: 'page2', title: 'Homepage two', site_id: 'site2' },
{ id: 'page3', title: 'Homepage three', site_id: 'site3' }
]
}
Based on this, bill[at]
companyone.com owns 'account1' and can
therefore edit both sites on his account (site1 and site2).
bill[at]
companytwo.com on the other hand can edit the site on his own
account (site3) but also the second site on bill's account (site2).
The only questions I have left now, if this all looks sane are should
I store the editor_id's in a site (as the example) or would I be
better storing the site_id's in a user for the sites he's allowed to
edit? Also, should I embed the pages within the sites?
Thanks again,
Jamie
> ...
>
> read more »