feat: scoped responsibility selectors, home card layouts and network topology
This commit is contained in:
@@ -177,12 +177,16 @@ class Accounts:
|
||||
family = self.a.HOUSEHOLDS.scope(user)
|
||||
state['familyId'] = family
|
||||
state['households'] = self.a.HOUSEHOLDS.list(user)
|
||||
state['householdLayout'] = self.a.HOUSEHOLDS.layout(user)
|
||||
for key in ('sites', 'assets', 'cameras', 'recorders', 'devices'):
|
||||
state[key] = [x for x in state.get(key, []) if self.a.HOUSEHOLDS.family_of(x) == family]
|
||||
for key in ('assets', 'recorders', 'devices'):
|
||||
state[key] = [self.a.INVENTORY.display(x) for x in state[key]]
|
||||
if user['role'] != 'admin':
|
||||
state['scan'] = {}
|
||||
state['storage'] = {}
|
||||
if self.a.HOUSEHOLDS.manager(user):
|
||||
state['responsibilityOptions'] = self.a.INVENTORY.candidates(user)
|
||||
return state
|
||||
permitted = self.a.HOUSEHOLDS.site_ids(user)
|
||||
state['sites'] = [s for s in state['sites'] if s['id'] in permitted]
|
||||
|
||||
Reference in New Issue
Block a user