Add missing config.
MODIFY
src/authorization/DynamicAuthorizationFactory.ts
src/authorization/DynamicAuthorizationFactory.ts
@@ -6,6 +6,8 @@ import AssignedSitesCompaniesDynamicAuthorizationDataSource from './dynamic-data
import AssignedSitesCompaniesDynamicAuthorizationFilter from './dynamic-filters/AssignedSitesCompaniesDynamicAuthorizationFilter';
import DynamicAuthorizationDataSource from './DynamicAuthorizationDataSource';
import DynamicAuthorizationFilter from './DynamicAuthorizationFilter';
+import SitesAdminDynamicAuthorizationDataSource from './dynamic-data-source/SitesAdminDynamicAuthorizationDataSource';
+import SitesAdminDynamicAuthorizationFilter from './dynamic-filters/SitesAdminDynamicAuthorizationFilter';
import Tenant from '../types/Tenant';
import UserToken from '../types/UserToken';
@@ -19,6 +21,9 @@ export default class DynamicAuthorizationFactory {
case DynamicAuthorizationFilterName.ASSIGNED_SITES_COMPANIES:
dynamicFilter = new AssignedSitesCompaniesDynamicAuthorizationFilter(tenant, userToken);
break;
+ case DynamicAuthorizationFilterName.SITES_ADMIN:
+ dynamicFilter = new SitesAdminDynamicAuthorizationFilter(tenant, userToken);
+ break;
case DynamicAuthorizationFilterName.ASSIGNED_SITE_AREAS:
dynamicFilter = new AssignedSiteAreasDynamicAuthorizationFilter(tenant, userToken);
break;
@@ -56,6 +61,8 @@ export default class DynamicAuthorizationFactory {
switch (dataSource) {
case DynamicAuthorizationDataSourceName.ASSIGNED_SITES_COMPANIES:
return new AssignedSitesCompaniesDynamicAuthorizationDataSource(tenant, user);
+ case DynamicAuthorizationDataSourceName.SITES_ADMIN:
+ return new SitesAdminDynamicAuthorizationDataSource(tenant, user);
case DynamicAuthorizationDataSourceName.ASSIGNED_SITE_AREAS:
return new AssignedSiteAreasDynamicAuthorizationDataSource(tenant, user);
}

MODIFY
src/types/Authorization.ts
src/types/Authorization.ts
@@ -177,11 +177,13 @@ export interface AuthorizationActions {
export enum DynamicAuthorizationFilterName {
ASSIGNED_SITES_COMPANIES = 'AssignedSitesCompanies',
+ SITES_ADMIN = 'SitesAdmin',
ASSIGNED_SITE_AREAS = 'AssignedSiteAreas',
}
export enum DynamicAuthorizationDataSourceName {
ASSIGNED_SITES_COMPANIES = 'AssignedSitesCompanies',
+ SITES_ADMIN = 'SitesAdmin',
ASSIGNED_SITE_AREAS = 'AssignedSiteAreas',
}
@@ -191,6 +193,10 @@ export interface AssignedSitesCompaniesDynamicAuthorizationDataSourceData extend
companyIDs?: string[];
}
+export interface SitesAdminDynamicAuthorizationDataSourceData extends DynamicAuthorizationDataSourceData {
+ siteIDs?: string[];
+}
+
export interface AssignedSiteAreasDynamicAuthorizationDataSourceData extends DynamicAuthorizationDataSourceData {
siteAreaIDs?: string[];
}

Add missing config.