Report fix on Site Admin dynamic filter on other filters
MODIFY
src/authorization/dynamic-filters/AssignedSitesCompaniesDynamicAuthorizationFilter.ts
src/authorization/dynamic-filters/AssignedSitesCompaniesDynamicAuthorizationFilter.ts
import { AuthorizationFilter, DynamicAuthorizationDataSourceName, Entity } from '../../types/Authorization';
-
+import Utils from '../../utils/Utils';
import AssignedSitesCompaniesDynamicAuthorizationDataSource from '../dynamic-data-source/AssignedSitesCompaniesDynamicAuthorizationDataSource';
import DynamicAuthorizationFilter from '../DynamicAuthorizationFilter';
-import Utils from '../../utils/Utils';
export default class AssignedSitesCompaniesDynamicAuthorizationFilter extends DynamicAuthorizationFilter {
public processFilter(authorizationFilters: AuthorizationFilter, extraFilters: Record<string, any>): void {
@@ -10,6 +9,8 @@ export default class AssignedSitesCompaniesDynamicAuthorizationFilter extends Dy
const assignedSitesCompaniesDataSource = this.getDataSource(
DynamicAuthorizationDataSourceName.ASSIGNED_SITES_COMPANIES) as AssignedSitesCompaniesDynamicAuthorizationDataSource;
const { companyIDs } = assignedSitesCompaniesDataSource.getData();
+ // Clear
+ authorizationFilters.filters.companyIDs = [];
// Check
if (!Utils.isEmptyArray(companyIDs)) {
// Force the filter

MODIFY
src/authorization/dynamic-filters/AssignedSitesDynamicAuthorizationFilter.ts
src/authorization/dynamic-filters/AssignedSitesDynamicAuthorizationFilter.ts
import { AuthorizationFilter, DynamicAuthorizationDataSourceName, Entity } from '../../types/Authorization';
-
+import Utils from '../../utils/Utils';
import AssignedSitesDynamicAuthorizationDataSource from '../dynamic-data-source/AssignedSitesDynamicAuthorizationDataSource';
import DynamicAuthorizationFilter from '../DynamicAuthorizationFilter';
-import Utils from '../../utils/Utils';
export default class AssignedSitesDynamicAuthorizationFilter extends DynamicAuthorizationFilter {
public processFilter(authorizationFilters: AuthorizationFilter, extraFilters: Record<string, any>): void {
@@ -10,6 +9,8 @@ export default class AssignedSitesDynamicAuthorizationFilter extends DynamicAuth
const assignedSitesDataSource = this.getDataSource(
DynamicAuthorizationDataSourceName.ASSIGNED_SITES) as AssignedSitesDynamicAuthorizationDataSource;
const { siteIDs } = assignedSitesDataSource.getData();
+ // Clear
+ authorizationFilters.filters.siteIDs = [];
// Check
if (!Utils.isEmptyArray(siteIDs)) {
// Force the filter

MODIFY
src/authorization/dynamic-filters/OwnUserDynamicAuthorizationFilter.ts
src/authorization/dynamic-filters/OwnUserDynamicAuthorizationFilter.ts
import { AuthorizationFilter, DynamicAuthorizationDataSourceName, Entity } from '../../types/Authorization';
-
-import DynamicAuthorizationFilter from '../DynamicAuthorizationFilter';
-import OwnUserDynamicAuthorizationDataSource from '../dynamic-data-source/OwnUserDynamicAuthorizationDataSource';
import Utils from '../../utils/Utils';
+import OwnUserDynamicAuthorizationDataSource from '../dynamic-data-source/OwnUserDynamicAuthorizationDataSource';
+import DynamicAuthorizationFilter from '../DynamicAuthorizationFilter';
export default class OwnUserDynamicAuthorizationFilter extends DynamicAuthorizationFilter {
public processFilter(authorizationFilters: AuthorizationFilter, extraFilters: Record<string, any>): void {
@@ -10,6 +9,8 @@ export default class OwnUserDynamicAuthorizationFilter extends DynamicAuthorizat
const ownUserDataSource = this.getDataSource(
DynamicAuthorizationDataSourceName.OWN_USER) as OwnUserDynamicAuthorizationDataSource;
const { userID } = ownUserDataSource.getData();
+ // Clear
+ authorizationFilters.filters.userIDs = [];
// Check
if (userID) {
// Force the filter

MODIFY
src/authorization/dynamic-filters/SitesOwnerDynamicAuthorizationFilter.ts
src/authorization/dynamic-filters/SitesOwnerDynamicAuthorizationFilter.ts
import { AuthorizationFilter, DynamicAuthorizationDataSourceName, Entity } from '../../types/Authorization';
-
-import DynamicAuthorizationFilter from '../DynamicAuthorizationFilter';
-import SitesOwnerDynamicAuthorizationDataSource from '../dynamic-data-source/SitesOwnerDynamicAuthorizationDataSource';
import Utils from '../../utils/Utils';
+import SitesOwnerDynamicAuthorizationDataSource from '../dynamic-data-source/SitesOwnerDynamicAuthorizationDataSource';
+import DynamicAuthorizationFilter from '../DynamicAuthorizationFilter';
export default class SitesOwnerDynamicAuthorizationFilter extends DynamicAuthorizationFilter {
public processFilter(authorizationFilters: AuthorizationFilter, extraFilters: Record<string, any>): void {
@@ -10,6 +9,8 @@ export default class SitesOwnerDynamicAuthorizationFilter extends DynamicAuthori
const sitesOwnerDataSource = this.getDataSource(
DynamicAuthorizationDataSourceName.SITES_OWNER) as SitesOwnerDynamicAuthorizationDataSource;
const { siteIDs } = sitesOwnerDataSource.getData();
+ // Clear
+ authorizationFilters.filters.siteIDs = [];
// Check
if (!Utils.isEmptyArray(siteIDs)) {
// Force the filter

Report fix on Site Admin dynamic filter on other filters