From 42e117deb1a3f9b61cb09ee9435599020703ba2f Mon Sep 17 00:00:00 2001 From: Christopher Bisset Date: Thu, 18 Aug 2022 13:02:05 +1000 Subject: [PATCH] added skeleton ACL class --- src/lib/common/classes.ts | 8 ++++++++ src/lib/common/stores.js | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/common/classes.ts b/src/lib/common/classes.ts index 22a7f00..5384a6e 100644 --- a/src/lib/common/classes.ts +++ b/src/lib/common/classes.ts @@ -14,6 +14,14 @@ export class Device { } } +export class ACL { + public groups: {[key: string]: string} = {} + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} + export class Route { advertisedRoutes: string[] = []; enabledRoutes: string[] = []; diff --git a/src/lib/common/stores.js b/src/lib/common/stores.js index 0873d52..b3502a1 100644 --- a/src/lib/common/stores.js +++ b/src/lib/common/stores.js @@ -1,5 +1,5 @@ import { writable } from 'svelte/store'; -import { Device, User } from '$lib/common/classes'; +import { Device, User, ACL } from '$lib/common/classes'; // used to store the value of an alert across all components export const alertStore = writable(''); @@ -24,4 +24,6 @@ export const deviceSearchStore = writable(''); export const deviceSortStore = writable('id'); export const deviceSortDirectionStore = writable('ascending'); export const userSortStore = writable('id'); -export const sortDirectionStore = writable('ascending'); \ No newline at end of file +export const sortDirectionStore = writable('ascending'); +// stores ACL object +export const aclStore = writable(new ACL()); \ No newline at end of file