Show external organisation information
* Show external org info
Basic user can now see external company info
* Use IncludeAllExternalSites
Show charging stations of external sites in sitearea
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -759,7 +759,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSitesCompanies', 'LocalIssuer']
+ filters: []
}
},
attributes: [
@@ -774,7 +774,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSitesCompanies', 'LocalIssuer']
+ filters: []
}
},
attributes: [
@@ -845,7 +845,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSites', 'LocalIssuer']
+ filters: []
}
},
attributes: [
@@ -861,7 +861,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSites', 'LocalIssuer']
+ filters: []
}
},
attributes: [
@@ -877,7 +877,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSites']
+ filters: []
}
},
attributes: [
@@ -889,13 +889,29 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
],
},
{
- resource: Entity.SITE_AREA,
- action: [Action.READ, Action.READ_CHARGING_STATIONS_FROM_SITE_AREA],
+ resource: Entity.SITE_AREA, action: Action.READ,
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSites']
+ filters: []
+ }
+ },
+ attributes: [
+ 'id', 'name', 'issuer', 'image', 'maximumPower', 'numberOfPhases',
+ 'voltage', 'smartCharging', 'accessControl', 'connectorStats', 'siteID',
+ 'parentSiteAreaID', 'site.name', 'parentSiteArea.name',
+ 'address.address1', 'address.address2', 'address.postalCode', 'address.city',
+ 'address.department', 'address.region', 'address.country', 'address.coordinates'
+ ],
+ },
+ {
+ resource: Entity.SITE_AREA, action: Action.READ_CHARGING_STATIONS_FROM_SITE_AREA,
+ condition: {
+ Fn: 'custom:dynamicAuthorizations',
+ args: {
+ asserts: [],
+ filters: [['AssignedSites', 'IncludeAllExternalSites']]
}
},
attributes: [
@@ -1395,7 +1411,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['AssignedSites', 'LocalIssuer'],
+ filters: [],
metadata: {
autoUserSiteAssignment: {
enabled: false,
@@ -1427,8 +1443,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
},
},
{
- resource: Entity.SITE_AREA,
- action: [Action.READ],
+ resource: Entity.SITE_AREA, action: Action.READ,
attributes: [
'id', 'name', 'issuer', 'image', 'maximumPower', 'numberOfPhases',
'voltage', 'smartCharging', 'accessControl', 'connectorStats',
@@ -1438,8 +1453,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
]
},
{
- resource: Entity.SITE_AREA,
- action: [Action.READ_ASSETS_FROM_SITE_AREA],
+ resource: Entity.SITE_AREA, action: Action.READ_ASSETS_FROM_SITE_AREA,
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {

MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -563,7 +563,8 @@ export default class AuthorizationService {
siteArea.canUnassignChargingStations = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE_AREA, Action.UNASSIGN_CHARGING_STATIONS_FROM_SITE_AREA, authorizationFilter, { SiteAreaID: siteArea.id, SiteID: siteArea.siteID }, siteArea);
siteArea.canReadChargingStations = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.SITE_AREA, Action.READ_CHARGING_STATIONS_FROM_SITE_AREA, authorizationFilter, { SiteAreaID: siteArea.id, SiteID: siteArea.siteID }, siteArea);
+ tenant, userToken, Entity.SITE_AREA, Action.READ_CHARGING_STATIONS_FROM_SITE_AREA, authorizationFilter,
+ { SiteAreaID: siteArea.id, SiteID: siteArea.siteID, Issuer: siteArea.issuer }, siteArea);
siteArea.canExportOCPPParams = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE_AREA, Action.EXPORT_OCPP_PARAMS, authorizationFilter, { SiteAreaID: siteArea.id, SiteID: siteArea.siteID }, siteArea);
siteArea.canGenerateQrCode = await AuthorizationService.canPerformAuthorizationAction(

Show external organisation information (#3655)

* Show external org info

- Basic user can now see external company info

* Use IncludeAllExternalSites

- Show charging stations of external sites in sitearea