Removed check of issuer
MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -88,9 +88,6 @@ export default class AuthorizationService {
}
public static async addSiteAuthorizations(tenant: Tenant, userToken: UserToken, site: Site, authorizationFilter: AuthorizationFilter): Promise<void> {
- if (!site.issuer) {
- site.canRead = true;
- } else {
site.canRead = true; // Always true as it should be filtered upfront
site.canDelete = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE, Action.DELETE, authorizationFilter, { SiteID: site.id }, site);
@@ -109,7 +106,6 @@ export default class AuthorizationService {
// Optimize data over the net
Utils.removeCanPropertiesWithFalseValue(site);
}
- }
public static async addLogsAuthorizations(tenant: Tenant, userToken: UserToken, logs: LogDataResult, authorizationFilter: AuthorizationFilter): Promise<void> {
logs.canExport = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.LOGGING, Action.EXPORT, authorizationFilter);
@@ -366,9 +362,6 @@ export default class AuthorizationService {
}
public static async addCompanyAuthorizations(tenant: Tenant, userToken: UserToken, company: Company, authorizationFilter: AuthorizationFilter): Promise<void> {
- if (!company.issuer) {
- company.canRead = true;
- } else {
company.canRead = true; // Always true as it should be filtered upfront
company.canDelete = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.COMPANY, Action.DELETE, authorizationFilter, { CompanyID: company.id }, company);
@@ -377,7 +370,6 @@ export default class AuthorizationService {
// Optimize data over the net
Utils.removeCanPropertiesWithFalseValue(company);
}
- }
public static async checkAndGetCompanyAuthorizations(tenant: Tenant, userToken: UserToken,
filteredRequest: Partial<HttpCompanyRequest>, authAction: Action, entityData?: EntityData): Promise<AuthorizationFilter> {

Removed check of issuer