@c8y/ngx-components 1017.0.76 → 1017.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6177,12 +6177,17 @@ class TenantUiService {
6177
6177
  * @returns True, if current tenant is an enterprise tenant.
6178
6178
  */
6179
6179
  async isEnterpriseTenant() {
6180
- const hasBranding = (await this.hasApp({ name: 'branding' })) ||
6181
- (await this.hasApp({ name: 'feature-branding' }));
6182
- const hasSslManagement = await this.hasApp({ name: 'sslmanagement' });
6183
- const hasUserHierarchy = await this.hasApp({ name: 'feature-user-hierarchy' });
6184
- const hasDataBroker = await this.hasApp({ name: 'feature-broker' });
6185
- return hasBranding && hasSslManagement && hasUserHierarchy && hasDataBroker;
6180
+ const { data: availableAppsOfUser } = await this.applicationService.listByUser(this.appStateService.currentUser.value, {
6181
+ dropOverwrittenApps: true,
6182
+ noPaging: true
6183
+ });
6184
+ const brandingAvailable = this.hasApp(availableAppsOfUser, 'branding') ||
6185
+ this.hasApp(availableAppsOfUser, 'feature-branding');
6186
+ const requiredAppsAndFeaturesAvailable = brandingAvailable &&
6187
+ this.hasApp(availableAppsOfUser, 'sslmanagement') &&
6188
+ this.hasApp(availableAppsOfUser, 'feature-user-hierarchy') &&
6189
+ this.hasApp(availableAppsOfUser, 'feature-broker');
6190
+ return requiredAppsAndFeaturesAvailable;
6186
6191
  }
6187
6192
  /**
6188
6193
  * Checks whether the current user has read access to tenants, i.e.:
@@ -6353,8 +6358,11 @@ class TenantUiService {
6353
6358
  .map(appRef => appRef.application)
6354
6359
  .filter(app => app.type === ApplicationType.MICROSERVICE);
6355
6360
  }
6356
- async hasApp(app) {
6357
- return (await this.applicationService.isAvailable(app)).data;
6361
+ hasApp(apps, requiredAppName) {
6362
+ if (!apps?.length) {
6363
+ return false;
6364
+ }
6365
+ return apps.some(app => app.name === requiredAppName);
6358
6366
  }
6359
6367
  isManagement(currentTenant) {
6360
6368
  return currentTenant.name === this.MANAGEMENT;