@kalisio/kdk 1.4.0 → 1.5.1
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.
- package/.nyc_output/{0f1a87aa-d3bb-4c61-8c1e-12294055358d.json → 058fc679-d60a-4501-ac04-71171e5200b8.json} +0 -0
- package/.nyc_output/2226bcce-9d22-4dad-b9fa-46564b5565c7.json +1 -0
- package/.nyc_output/6dc4b140-1a8a-4d69-b91c-89c557883d6e.json +1 -0
- package/.nyc_output/{8be4cd9f-124a-41f9-80f4-f267ced63c86.json → 8b1830fa-932e-4a61-9837-4a5b18f83ea9.json} +0 -0
- package/.nyc_output/{a63b0924-fd09-4e30-974f-cb4be2243b66.json → afd2d144-3570-4858-b94a-b523dbd023dd.json} +0 -0
- package/.nyc_output/processinfo/058fc679-d60a-4501-ac04-71171e5200b8.json +1 -0
- package/.nyc_output/processinfo/{27204015-ebfd-456f-a3bb-6a94f71946b8.json → 2226bcce-9d22-4dad-b9fa-46564b5565c7.json} +1 -1
- package/.nyc_output/processinfo/6dc4b140-1a8a-4d69-b91c-89c557883d6e.json +1 -0
- package/.nyc_output/processinfo/8b1830fa-932e-4a61-9837-4a5b18f83ea9.json +1 -0
- package/.nyc_output/processinfo/afd2d144-3570-4858-b94a-b523dbd023dd.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +219 -68
- package/coverage/core/api/application.js.html +455 -455
- package/coverage/core/api/authentication.js.html +119 -119
- package/coverage/core/api/db.js.html +201 -201
- package/coverage/core/api/hooks/hooks.account.js.html +48 -48
- package/coverage/core/api/hooks/hooks.authentication.js.html +64 -64
- package/coverage/core/api/hooks/hooks.authorisations.js.html +353 -353
- package/coverage/core/api/hooks/hooks.devices.js.html +22 -22
- package/coverage/core/api/hooks/hooks.groups.js.html +37 -37
- package/coverage/core/api/hooks/hooks.logger.js.html +27 -27
- package/coverage/core/api/hooks/hooks.model.js.html +269 -269
- package/coverage/core/api/hooks/hooks.organisations.js.html +183 -231
- package/coverage/core/api/hooks/hooks.pusher.js.html +114 -114
- package/coverage/core/api/hooks/hooks.query.js.html +200 -200
- package/coverage/core/api/hooks/hooks.service.js.html +82 -82
- package/coverage/core/api/hooks/hooks.storage.js.html +121 -121
- package/coverage/core/api/hooks/hooks.tags.js.html +232 -232
- package/coverage/core/api/hooks/hooks.users.js.html +261 -261
- package/coverage/core/api/hooks/index.html +167 -167
- package/coverage/core/api/hooks/index.js.html +24 -24
- package/coverage/core/api/index.html +75 -75
- package/coverage/core/api/index.js.html +26 -26
- package/coverage/core/api/marshall.js.html +57 -57
- package/coverage/core/api/models/groups.model.mongodb.js.html +20 -20
- package/coverage/core/api/models/index.html +50 -50
- package/coverage/core/api/models/organisations.model.mongodb.js.html +12 -12
- package/coverage/core/api/models/tags.model.mongodb.js.html +22 -22
- package/coverage/core/api/models/users.model.mongodb.js.html +20 -20
- package/coverage/core/api/oauth2-handler.js.html +18 -18
- package/coverage/core/api/oauth2-verifier.js.html +38 -38
- package/coverage/core/api/services/account/account.hooks.js.html +16 -16
- package/coverage/core/api/services/account/account.service.js.html +108 -108
- package/coverage/core/api/services/account/index.html +32 -32
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +9 -9
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +132 -132
- package/coverage/core/api/services/authorisations/index.html +28 -28
- package/coverage/core/api/services/databases/databases.hooks.js.html +9 -9
- package/coverage/core/api/services/databases/databases.service.js.html +12 -12
- package/coverage/core/api/services/databases/index.html +24 -24
- package/coverage/core/api/services/devices/devices.hooks.js.html +9 -9
- package/coverage/core/api/services/devices/devices.service.js.html +61 -61
- package/coverage/core/api/services/devices/index.html +22 -22
- package/coverage/core/api/services/groups/groups.hooks.js.html +9 -9
- package/coverage/core/api/services/groups/index.html +13 -13
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +137 -137
- package/coverage/core/api/services/mailer/index.html +24 -24
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +9 -9
- package/coverage/core/api/services/mailer/mailer.service.js.html +19 -19
- package/coverage/core/api/services/organisations/index.html +24 -24
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +8 -8
- package/coverage/core/api/services/organisations/organisations.service.js.html +67 -67
- package/coverage/core/api/services/pusher/index.html +32 -32
- package/coverage/core/api/services/pusher/pusher.channels.js.html +8 -8
- package/coverage/core/api/services/pusher/pusher.hooks.js.html +10 -10
- package/coverage/core/api/services/pusher/pusher.service.js.html +336 -336
- package/coverage/core/api/services/storage/index.html +21 -21
- package/coverage/core/api/services/storage/storage.hooks.js.html +35 -35
- package/coverage/core/api/services/tags/index.html +21 -21
- package/coverage/core/api/services/tags/tags.hooks.js.html +25 -25
- package/coverage/core/api/services/users/index.html +21 -21
- package/coverage/core/api/services/users/users.hooks.js.html +33 -33
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +16 -16
- package/coverage/core/common/permissions.js.html +274 -274
- package/coverage/index.html +174 -174
- package/coverage/lcov-report/core/api/application.js.html +455 -455
- package/coverage/lcov-report/core/api/authentication.js.html +119 -119
- package/coverage/lcov-report/core/api/db.js.html +201 -201
- package/coverage/lcov-report/core/api/hooks/hooks.account.js.html +48 -48
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +64 -64
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +353 -353
- package/coverage/lcov-report/core/api/hooks/hooks.devices.js.html +22 -22
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +37 -37
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +27 -27
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +269 -269
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +183 -231
- package/coverage/lcov-report/core/api/hooks/hooks.pusher.js.html +114 -114
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +200 -200
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +82 -82
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +121 -121
- package/coverage/lcov-report/core/api/hooks/hooks.tags.js.html +232 -232
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +261 -261
- package/coverage/lcov-report/core/api/hooks/index.html +167 -167
- package/coverage/lcov-report/core/api/hooks/index.js.html +24 -24
- package/coverage/lcov-report/core/api/index.html +75 -75
- package/coverage/lcov-report/core/api/index.js.html +26 -26
- package/coverage/lcov-report/core/api/marshall.js.html +57 -57
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +20 -20
- package/coverage/lcov-report/core/api/models/index.html +50 -50
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +12 -12
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +22 -22
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +20 -20
- package/coverage/lcov-report/core/api/oauth2-handler.js.html +18 -18
- package/coverage/lcov-report/core/api/oauth2-verifier.js.html +38 -38
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +16 -16
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +108 -108
- package/coverage/lcov-report/core/api/services/account/index.html +32 -32
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +132 -132
- package/coverage/lcov-report/core/api/services/authorisations/index.html +28 -28
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +12 -12
- package/coverage/lcov-report/core/api/services/databases/index.html +24 -24
- package/coverage/lcov-report/core/api/services/devices/devices.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/devices/devices.service.js.html +61 -61
- package/coverage/lcov-report/core/api/services/devices/index.html +22 -22
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/groups/index.html +13 -13
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +137 -137
- package/coverage/lcov-report/core/api/services/mailer/index.html +24 -24
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +19 -19
- package/coverage/lcov-report/core/api/services/organisations/index.html +24 -24
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +8 -8
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +67 -67
- package/coverage/lcov-report/core/api/services/pusher/index.html +32 -32
- package/coverage/lcov-report/core/api/services/pusher/pusher.channels.js.html +8 -8
- package/coverage/lcov-report/core/api/services/pusher/pusher.hooks.js.html +10 -10
- package/coverage/lcov-report/core/api/services/pusher/pusher.service.js.html +336 -336
- package/coverage/lcov-report/core/api/services/storage/index.html +21 -21
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +35 -35
- package/coverage/lcov-report/core/api/services/tags/index.html +21 -21
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +25 -25
- package/coverage/lcov-report/core/api/services/users/index.html +21 -21
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +33 -33
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +42 -27
- package/coverage/lcov-report/core/common/index.js.html +16 -16
- package/coverage/lcov-report/core/common/permissions.js.html +274 -274
- package/coverage/lcov-report/index.html +174 -174
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +72 -18
- package/coverage/lcov-report/map/api/hooks/index.html +7 -7
- package/coverage/lcov-report/map/api/hooks/index.js.html +1 -1
- package/coverage/lcov-report/map/api/index.html +1 -1
- package/coverage/lcov-report/map/api/index.js.html +1 -1
- package/coverage/lcov-report/map/api/marshall.js.html +1 -1
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/index.html +1 -1
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/catalog/index.html +1 -1
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/features/index.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/index.html +1 -1
- package/coverage/lcov-report/map/api/services/index.html +1 -1
- package/coverage/lcov-report/map/api/services/index.js.html +1 -1
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/errors.js.html +1 -1
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +1 -1
- package/coverage/lcov-report/map/common/index.js.html +1 -1
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/moment-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/permissions.js.html +1 -1
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wcs-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wfs-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wms-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wmts-utils.js.html +1 -1
- package/coverage/lcov.info +3289 -3610
- package/coverage/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +72 -18
- package/coverage/map/api/hooks/index.html +7 -7
- package/coverage/map/api/hooks/index.js.html +1 -1
- package/coverage/map/api/index.html +1 -1
- package/coverage/map/api/index.js.html +1 -1
- package/coverage/map/api/marshall.js.html +1 -1
- package/coverage/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/catalog.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +1 -1
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/map/api/services/alerts/index.html +1 -1
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +1 -1
- package/coverage/map/api/services/catalog/index.html +1 -1
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/map/api/services/daptiles/index.html +1 -1
- package/coverage/map/api/services/features/features.hooks.js.html +1 -1
- package/coverage/map/api/services/features/index.html +1 -1
- package/coverage/map/api/services/geocoder/geocoder.hooks.js.html +1 -1
- package/coverage/map/api/services/geocoder/geocoder.service.js.html +1 -1
- package/coverage/map/api/services/geocoder/index.html +1 -1
- package/coverage/map/api/services/index.html +1 -1
- package/coverage/map/api/services/index.js.html +1 -1
- package/coverage/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/map/common/errors.js.html +1 -1
- package/coverage/map/common/geotiff-grid-source.js.html +1 -1
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +1 -1
- package/coverage/map/common/index.js.html +1 -1
- package/coverage/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/map/common/moment-utils.js.html +1 -1
- package/coverage/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/map/common/opendap-utils.js.html +1 -1
- package/coverage/map/common/permissions.js.html +1 -1
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +1 -1
- package/coverage/map/common/wcs-grid-source.js.html +1 -1
- package/coverage/map/common/wcs-utils.js.html +1 -1
- package/coverage/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/map/common/wfs-utils.js.html +1 -1
- package/coverage/map/common/wms-utils.js.html +1 -1
- package/coverage/map/common/wmts-utils.js.html +1 -1
- package/lib/core/client/components/collection/KBoard.vue +6 -0
- package/lib/core/client/components/collection/KColumn.vue +2 -2
- package/lib/core/client/components/collection/KHistory.vue +14 -6
- package/lib/core/client/components/collection/KHistoryEntry.vue +7 -3
- package/lib/core/client/components/form/KFileField.vue +11 -40
- package/lib/core/client/components/frame/KChipsPane.vue +2 -2
- package/lib/core/client/components/input/KOptionsChooser.vue +2 -2
- package/lib/core/client/i18n/core_en.json +7 -1
- package/lib/core/client/i18n/core_fr.json +7 -1
- package/lib/core/client/index.js +18 -0
- package/lib/core/client/index.js.map +1 -1
- package/lib/core/client/layout.js +8 -1
- package/lib/core/client/layout.js.map +1 -1
- package/lib/core/client/mixins/mixin.base-collection.js +8 -2
- package/lib/core/client/mixins/mixin.base-collection.js.map +1 -1
- package/lib/core/client/reader.js +54 -0
- package/lib/core/client/reader.js.map +1 -0
- package/lib/core/client/readers/index.js +30 -0
- package/lib/core/client/readers/index.js.map +1 -0
- package/lib/core/client/readers/reader.csv.js +43 -0
- package/lib/core/client/readers/reader.csv.js.map +1 -0
- package/lib/core/client/readers/reader.json.js +38 -0
- package/lib/core/client/readers/reader.json.js.map +1 -0
- package/lib/core/client/services/index.js +1 -3
- package/lib/core/client/services/index.js.map +1 -1
- package/lib/core/client/time.js +4 -1
- package/lib/core/client/time.js.map +1 -1
- package/lib/map/api/hooks/hooks.query.js +30 -13
- package/lib/map/api/hooks/hooks.query.js.map +1 -1
- package/lib/map/client/components/KCaptureToolbar.vue +156 -0
- package/lib/map/client/components/KFeaturesFilter.vue +3 -1
- package/lib/map/client/components/KLayerEditionToolbar.vue +19 -11
- package/lib/map/client/components/KLayerStyleEditor.vue +2 -1
- package/lib/map/client/components/KLayerStyleForm.vue +34 -23
- package/lib/map/client/components/KLocationMap.vue +3 -1
- package/lib/map/client/components/KMeasureTool.vue +340 -0
- package/lib/map/client/components/KPositionIndicator.vue +1 -0
- package/lib/map/client/components/KTimeline.vue +7 -8
- package/lib/map/client/components/catalog/KImportLayer.vue +8 -35
- package/lib/map/client/components/catalog/KLayersSelector.vue +13 -11
- package/lib/map/client/components/form/KOwsLayerField.vue +7 -0
- package/lib/map/client/components/widget/KMapillaryViewer.vue +1 -1
- package/lib/map/client/components/widget/KTimeSeries.vue +81 -3
- package/lib/map/client/i18n/map_en.json +43 -5
- package/lib/map/client/i18n/map_fr.json +43 -5
- package/lib/map/client/init.js +6 -1
- package/lib/map/client/init.js.map +1 -1
- package/lib/map/client/leaflet/MaskLayer.js +12 -3
- package/lib/map/client/leaflet/MaskLayer.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.base-globe.js +3 -5
- package/lib/map/client/mixins/globe/mixin.base-globe.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.geojson-layers.js +0 -4
- package/lib/map/client/mixins/globe/mixin.geojson-layers.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.popup.js +4 -0
- package/lib/map/client/mixins/globe/mixin.popup.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.tooltip.js +4 -0
- package/lib/map/client/mixins/globe/mixin.tooltip.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.base-map.js +46 -7
- package/lib/map/client/mixins/map/mixin.base-map.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.canvas-layers.js +2 -0
- package/lib/map/client/mixins/map/mixin.canvas-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.file-layers.js +47 -101
- package/lib/map/client/mixins/map/mixin.file-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.geojson-layers.js +9 -5
- package/lib/map/client/mixins/map/mixin.geojson-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.heatmap-layers.js +0 -4
- package/lib/map/client/mixins/map/mixin.heatmap-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.popup.js +4 -0
- package/lib/map/client/mixins/map/mixin.popup.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.tooltip.js +4 -0
- package/lib/map/client/mixins/map/mixin.tooltip.js.map +1 -1
- package/lib/map/client/mixins/mixin.activity.js +2 -0
- package/lib/map/client/mixins/mixin.activity.js.map +1 -1
- package/lib/map/client/mixins/mixin.context.js +26 -3
- package/lib/map/client/mixins/mixin.context.js.map +1 -1
- package/lib/map/client/mixins/mixin.feature-service.js +4 -4
- package/lib/map/client/mixins/mixin.feature-service.js.map +1 -1
- package/lib/map/client/mixins/mixin.infobox.js +4 -0
- package/lib/map/client/mixins/mixin.infobox.js.map +1 -1
- package/lib/map/client/readers/index.js +42 -0
- package/lib/map/client/readers/index.js.map +1 -0
- package/lib/map/client/readers/reader.geojson.js +59 -0
- package/lib/map/client/readers/reader.geojson.js.map +1 -0
- package/lib/map/client/readers/reader.gpx.js +41 -0
- package/lib/map/client/readers/reader.gpx.js.map +1 -0
- package/lib/map/client/readers/reader.kml.js +41 -0
- package/lib/map/client/readers/reader.kml.js.map +1 -0
- package/lib/map/client/utils.js +2 -1
- package/lib/map/client/utils.js.map +1 -1
- package/lib/test/client/core/runner.js +1 -2
- package/lib/test/client/core/runner.js.map +1 -1
- package/lib/test/client/core/utils.js +58 -38
- package/lib/test/client/core/utils.js.map +1 -1
- package/lib/test/client/map/catalog.js +50 -49
- package/lib/test/client/map/catalog.js.map +1 -1
- package/package.json +3 -3
- package/.nyc_output/27204015-ebfd-456f-a3bb-6a94f71946b8.json +0 -1
- package/.nyc_output/d3d1fa81-57ca-4287-8fbe-96466b0e5aa1.json +0 -1
- package/.nyc_output/e921974a-3076-4e89-8dbf-6f37bef10583.json +0 -1
- package/.nyc_output/fb790367-ba9f-474f-84c1-f836caf9f50a.json +0 -1
- package/.nyc_output/processinfo/0f1a87aa-d3bb-4c61-8c1e-12294055358d.json +0 -1
- package/.nyc_output/processinfo/8be4cd9f-124a-41f9-80f4-f267ced63c86.json +0 -1
- package/.nyc_output/processinfo/a63b0924-fd09-4e30-974f-cb4be2243b66.json +0 -1
- package/.nyc_output/processinfo/d3d1fa81-57ca-4287-8fbe-96466b0e5aa1.json +0 -1
- package/.nyc_output/processinfo/e921974a-3076-4e89-8dbf-6f37bef10583.json +0 -1
- package/.nyc_output/processinfo/fb790367-ba9f-474f-84c1-f836caf9f50a.json +0 -1
- package/extras/testcafe/Dockerfile +0 -48
- package/extras/testcafe/docker-entrypoint.sh +0 -27
- package/extras/testcafe/page-models/core/account.js +0 -75
- package/extras/testcafe/page-models/core/base-collection.js +0 -41
- package/extras/testcafe/page-models/core/base-page.js +0 -25
- package/extras/testcafe/page-models/core/groups.js +0 -36
- package/extras/testcafe/page-models/core/index.js +0 -140
- package/extras/testcafe/page-models/core/layout.js +0 -145
- package/extras/testcafe/page-models/core/members.js +0 -98
- package/extras/testcafe/page-models/core/organisations.js +0 -76
- package/extras/testcafe/page-models/core/screens.js +0 -99
- package/extras/testcafe/page-models/core/tags.js +0 -21
- package/extras/testcafe/page-models/map/add-layer.js +0 -51
- package/extras/testcafe/page-models/map/catalog.js +0 -132
- package/extras/testcafe/page-models/map/index.js +0 -36
- package/extras/testcafe/page-models/map/map-activity.js +0 -42
- package/extras/testcafe/page-models/map/timeline.js +0 -67
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>0/192</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/143</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/23</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>0/182</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
57
|
</div>
|
|
58
|
-
<div class='status-line
|
|
58
|
+
<div class='status-line low'></div>
|
|
59
59
|
<pre><table class="coverage">
|
|
60
60
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
61
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -410,26 +410,26 @@
|
|
|
410
410
|
<a name='L351'></a><a href='#L351'>351</a>
|
|
411
411
|
<a name='L352'></a><a href='#L352'>352</a>
|
|
412
412
|
<a name='L353'></a><a href='#L353'>353</a>
|
|
413
|
-
<a name='L354'></a><a href='#L354'>354</a></td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
414
|
-
<span class="cline-any cline-yes">1x</span>
|
|
415
|
-
<span class="cline-any cline-yes">1x</span>
|
|
416
|
-
<span class="cline-any cline-yes">1x</span>
|
|
417
|
-
<span class="cline-any cline-yes">1x</span>
|
|
418
|
-
<span class="cline-any cline-yes">1x</span>
|
|
419
|
-
<span class="cline-any cline-yes">1x</span>
|
|
420
|
-
<span class="cline-any cline-yes">1x</span>
|
|
413
|
+
<a name='L354'></a><a href='#L354'>354</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
421
414
|
<span class="cline-any cline-neutral"> </span>
|
|
422
|
-
<span class="cline-any cline-yes">1x</span>
|
|
423
415
|
<span class="cline-any cline-neutral"> </span>
|
|
424
416
|
<span class="cline-any cline-neutral"> </span>
|
|
425
|
-
<span class="cline-any cline-yes">8x</span>
|
|
426
|
-
<span class="cline-any cline-yes">2x</span>
|
|
427
|
-
<span class="cline-any cline-yes">2x</span>
|
|
428
|
-
<span class="cline-any cline-yes">2x</span>
|
|
429
|
-
<span class="cline-any cline-yes">2x</span>
|
|
430
|
-
<span class="cline-any cline-yes">2x</span>
|
|
431
417
|
<span class="cline-any cline-neutral"> </span>
|
|
432
|
-
<span class="cline-any cline-
|
|
418
|
+
<span class="cline-any cline-neutral"> </span>
|
|
419
|
+
<span class="cline-any cline-neutral"> </span>
|
|
420
|
+
<span class="cline-any cline-neutral"> </span>
|
|
421
|
+
<span class="cline-any cline-neutral"> </span>
|
|
422
|
+
<span class="cline-any cline-no"> </span>
|
|
423
|
+
<span class="cline-any cline-neutral"> </span>
|
|
424
|
+
<span class="cline-any cline-neutral"> </span>
|
|
425
|
+
<span class="cline-any cline-no"> </span>
|
|
426
|
+
<span class="cline-any cline-no"> </span>
|
|
427
|
+
<span class="cline-any cline-no"> </span>
|
|
428
|
+
<span class="cline-any cline-no"> </span>
|
|
429
|
+
<span class="cline-any cline-no"> </span>
|
|
430
|
+
<span class="cline-any cline-no"> </span>
|
|
431
|
+
<span class="cline-any cline-neutral"> </span>
|
|
432
|
+
<span class="cline-any cline-no"> </span>
|
|
433
433
|
<span class="cline-any cline-neutral"> </span>
|
|
434
434
|
<span class="cline-any cline-neutral"> </span>
|
|
435
435
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -437,18 +437,18 @@
|
|
|
437
437
|
<span class="cline-any cline-neutral"> </span>
|
|
438
438
|
<span class="cline-any cline-neutral"> </span>
|
|
439
439
|
<span class="cline-any cline-neutral"> </span>
|
|
440
|
-
<span class="cline-any cline-
|
|
441
|
-
<span class="cline-any cline-
|
|
442
|
-
<span class="cline-any cline-
|
|
440
|
+
<span class="cline-any cline-no"> </span>
|
|
441
|
+
<span class="cline-any cline-no"> </span>
|
|
442
|
+
<span class="cline-any cline-no"> </span>
|
|
443
443
|
<span class="cline-any cline-neutral"> </span>
|
|
444
444
|
<span class="cline-any cline-neutral"> </span>
|
|
445
445
|
<span class="cline-any cline-neutral"> </span>
|
|
446
446
|
<span class="cline-any cline-neutral"> </span>
|
|
447
|
-
<span class="cline-any cline-
|
|
447
|
+
<span class="cline-any cline-no"> </span>
|
|
448
448
|
<span class="cline-any cline-no"> </span>
|
|
449
449
|
<span class="cline-any cline-neutral"> </span>
|
|
450
450
|
<span class="cline-any cline-neutral"> </span>
|
|
451
|
-
<span class="cline-any cline-
|
|
451
|
+
<span class="cline-any cline-no"> </span>
|
|
452
452
|
<span class="cline-any cline-neutral"> </span>
|
|
453
453
|
<span class="cline-any cline-neutral"> </span>
|
|
454
454
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -460,11 +460,11 @@
|
|
|
460
460
|
<span class="cline-any cline-neutral"> </span>
|
|
461
461
|
<span class="cline-any cline-neutral"> </span>
|
|
462
462
|
<span class="cline-any cline-neutral"> </span>
|
|
463
|
-
<span class="cline-any cline-
|
|
463
|
+
<span class="cline-any cline-no"> </span>
|
|
464
464
|
<span class="cline-any cline-no"> </span>
|
|
465
465
|
<span class="cline-any cline-neutral"> </span>
|
|
466
466
|
<span class="cline-any cline-neutral"> </span>
|
|
467
|
-
<span class="cline-any cline-
|
|
467
|
+
<span class="cline-any cline-no"> </span>
|
|
468
468
|
<span class="cline-any cline-neutral"> </span>
|
|
469
469
|
<span class="cline-any cline-neutral"> </span>
|
|
470
470
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -476,35 +476,35 @@
|
|
|
476
476
|
<span class="cline-any cline-neutral"> </span>
|
|
477
477
|
<span class="cline-any cline-neutral"> </span>
|
|
478
478
|
<span class="cline-any cline-neutral"> </span>
|
|
479
|
-
<span class="cline-any cline-
|
|
479
|
+
<span class="cline-any cline-no"> </span>
|
|
480
480
|
<span class="cline-any cline-no"> </span>
|
|
481
481
|
<span class="cline-any cline-neutral"> </span>
|
|
482
482
|
<span class="cline-any cline-neutral"> </span>
|
|
483
|
-
<span class="cline-any cline-
|
|
483
|
+
<span class="cline-any cline-no"> </span>
|
|
484
484
|
<span class="cline-any cline-neutral"> </span>
|
|
485
|
-
<span class="cline-any cline-
|
|
486
|
-
<span class="cline-any cline-
|
|
485
|
+
<span class="cline-any cline-no"> </span>
|
|
486
|
+
<span class="cline-any cline-no"> </span>
|
|
487
487
|
<span class="cline-any cline-neutral"> </span>
|
|
488
|
-
<span class="cline-any cline-
|
|
489
|
-
<span class="cline-any cline-
|
|
490
|
-
<span class="cline-any cline-
|
|
488
|
+
<span class="cline-any cline-no"> </span>
|
|
489
|
+
<span class="cline-any cline-no"> </span>
|
|
490
|
+
<span class="cline-any cline-no"> </span>
|
|
491
491
|
<span class="cline-any cline-neutral"> </span>
|
|
492
492
|
<span class="cline-any cline-neutral"> </span>
|
|
493
|
-
<span class="cline-any cline-
|
|
494
|
-
<span class="cline-any cline-
|
|
493
|
+
<span class="cline-any cline-no"> </span>
|
|
494
|
+
<span class="cline-any cline-no"> </span>
|
|
495
495
|
<span class="cline-any cline-neutral"> </span>
|
|
496
|
-
<span class="cline-any cline-
|
|
496
|
+
<span class="cline-any cline-no"> </span>
|
|
497
497
|
<span class="cline-any cline-neutral"> </span>
|
|
498
|
-
<span class="cline-any cline-
|
|
499
|
-
<span class="cline-any cline-
|
|
498
|
+
<span class="cline-any cline-no"> </span>
|
|
499
|
+
<span class="cline-any cline-no"> </span>
|
|
500
500
|
<span class="cline-any cline-neutral"> </span>
|
|
501
|
-
<span class="cline-any cline-
|
|
501
|
+
<span class="cline-any cline-no"> </span>
|
|
502
502
|
<span class="cline-any cline-neutral"> </span>
|
|
503
|
-
<span class="cline-any cline-
|
|
503
|
+
<span class="cline-any cline-no"> </span>
|
|
504
504
|
<span class="cline-any cline-neutral"> </span>
|
|
505
|
-
<span class="cline-any cline-
|
|
506
|
-
<span class="cline-any cline-
|
|
507
|
-
<span class="cline-any cline-
|
|
505
|
+
<span class="cline-any cline-no"> </span>
|
|
506
|
+
<span class="cline-any cline-no"> </span>
|
|
507
|
+
<span class="cline-any cline-no"> </span>
|
|
508
508
|
<span class="cline-any cline-no"> </span>
|
|
509
509
|
<span class="cline-any cline-no"> </span>
|
|
510
510
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -516,188 +516,188 @@
|
|
|
516
516
|
<span class="cline-any cline-neutral"> </span>
|
|
517
517
|
<span class="cline-any cline-neutral"> </span>
|
|
518
518
|
<span class="cline-any cline-neutral"> </span>
|
|
519
|
-
<span class="cline-any cline-
|
|
520
|
-
<span class="cline-any cline-
|
|
521
|
-
<span class="cline-any cline-
|
|
522
|
-
<span class="cline-any cline-
|
|
523
|
-
<span class="cline-any cline-
|
|
524
|
-
<span class="cline-any cline-
|
|
525
|
-
<span class="cline-any cline-
|
|
526
|
-
<span class="cline-any cline-
|
|
519
|
+
<span class="cline-any cline-no"> </span>
|
|
520
|
+
<span class="cline-any cline-no"> </span>
|
|
521
|
+
<span class="cline-any cline-no"> </span>
|
|
522
|
+
<span class="cline-any cline-no"> </span>
|
|
523
|
+
<span class="cline-any cline-no"> </span>
|
|
524
|
+
<span class="cline-any cline-no"> </span>
|
|
525
|
+
<span class="cline-any cline-no"> </span>
|
|
526
|
+
<span class="cline-any cline-no"> </span>
|
|
527
527
|
<span class="cline-any cline-neutral"> </span>
|
|
528
|
-
<span class="cline-any cline-
|
|
528
|
+
<span class="cline-any cline-no"> </span>
|
|
529
529
|
<span class="cline-any cline-neutral"> </span>
|
|
530
530
|
<span class="cline-any cline-neutral"> </span>
|
|
531
|
-
<span class="cline-any cline-
|
|
532
|
-
<span class="cline-any cline-
|
|
533
|
-
<span class="cline-any cline-
|
|
531
|
+
<span class="cline-any cline-no"> </span>
|
|
532
|
+
<span class="cline-any cline-no"> </span>
|
|
533
|
+
<span class="cline-any cline-no"> </span>
|
|
534
534
|
<span class="cline-any cline-neutral"> </span>
|
|
535
535
|
<span class="cline-any cline-neutral"> </span>
|
|
536
536
|
<span class="cline-any cline-neutral"> </span>
|
|
537
537
|
<span class="cline-any cline-neutral"> </span>
|
|
538
538
|
<span class="cline-any cline-neutral"> </span>
|
|
539
|
-
<span class="cline-any cline-
|
|
540
|
-
<span class="cline-any cline-
|
|
541
|
-
<span class="cline-any cline-
|
|
539
|
+
<span class="cline-any cline-no"> </span>
|
|
540
|
+
<span class="cline-any cline-no"> </span>
|
|
541
|
+
<span class="cline-any cline-no"> </span>
|
|
542
542
|
<span class="cline-any cline-no"> </span>
|
|
543
543
|
<span class="cline-any cline-neutral"> </span>
|
|
544
|
-
<span class="cline-any cline-
|
|
545
|
-
<span class="cline-any cline-
|
|
546
|
-
<span class="cline-any cline-
|
|
547
|
-
<span class="cline-any cline-
|
|
544
|
+
<span class="cline-any cline-no"> </span>
|
|
545
|
+
<span class="cline-any cline-no"> </span>
|
|
546
|
+
<span class="cline-any cline-no"> </span>
|
|
547
|
+
<span class="cline-any cline-no"> </span>
|
|
548
548
|
<span class="cline-any cline-neutral"> </span>
|
|
549
549
|
<span class="cline-any cline-neutral"> </span>
|
|
550
550
|
<span class="cline-any cline-neutral"> </span>
|
|
551
551
|
<span class="cline-any cline-neutral"> </span>
|
|
552
|
-
<span class="cline-any cline-
|
|
552
|
+
<span class="cline-any cline-no"> </span>
|
|
553
553
|
<span class="cline-any cline-neutral"> </span>
|
|
554
554
|
<span class="cline-any cline-neutral"> </span>
|
|
555
555
|
<span class="cline-any cline-neutral"> </span>
|
|
556
|
-
<span class="cline-any cline-
|
|
556
|
+
<span class="cline-any cline-no"> </span>
|
|
557
557
|
<span class="cline-any cline-no"> </span>
|
|
558
558
|
<span class="cline-any cline-neutral"> </span>
|
|
559
|
-
<span class="cline-any cline-
|
|
560
|
-
<span class="cline-any cline-
|
|
561
|
-
<span class="cline-any cline-
|
|
562
|
-
<span class="cline-any cline-
|
|
563
|
-
<span class="cline-any cline-
|
|
564
|
-
<span class="cline-any cline-
|
|
559
|
+
<span class="cline-any cline-no"> </span>
|
|
560
|
+
<span class="cline-any cline-no"> </span>
|
|
561
|
+
<span class="cline-any cline-no"> </span>
|
|
562
|
+
<span class="cline-any cline-no"> </span>
|
|
563
|
+
<span class="cline-any cline-no"> </span>
|
|
564
|
+
<span class="cline-any cline-no"> </span>
|
|
565
565
|
<span class="cline-any cline-neutral"> </span>
|
|
566
566
|
<span class="cline-any cline-neutral"> </span>
|
|
567
|
-
<span class="cline-any cline-
|
|
568
|
-
<span class="cline-any cline-
|
|
567
|
+
<span class="cline-any cline-no"> </span>
|
|
568
|
+
<span class="cline-any cline-no"> </span>
|
|
569
569
|
<span class="cline-any cline-neutral"> </span>
|
|
570
|
-
<span class="cline-any cline-
|
|
571
|
-
<span class="cline-any cline-
|
|
572
|
-
<span class="cline-any cline-
|
|
570
|
+
<span class="cline-any cline-no"> </span>
|
|
571
|
+
<span class="cline-any cline-no"> </span>
|
|
572
|
+
<span class="cline-any cline-no"> </span>
|
|
573
573
|
<span class="cline-any cline-neutral"> </span>
|
|
574
574
|
<span class="cline-any cline-neutral"> </span>
|
|
575
|
-
<span class="cline-any cline-
|
|
576
|
-
<span class="cline-any cline-
|
|
577
|
-
<span class="cline-any cline-
|
|
575
|
+
<span class="cline-any cline-no"> </span>
|
|
576
|
+
<span class="cline-any cline-no"> </span>
|
|
577
|
+
<span class="cline-any cline-no"> </span>
|
|
578
578
|
<span class="cline-any cline-neutral"> </span>
|
|
579
579
|
<span class="cline-any cline-neutral"> </span>
|
|
580
|
-
<span class="cline-any cline-
|
|
581
|
-
<span class="cline-any cline-
|
|
580
|
+
<span class="cline-any cline-no"> </span>
|
|
581
|
+
<span class="cline-any cline-no"> </span>
|
|
582
582
|
<span class="cline-any cline-neutral"> </span>
|
|
583
|
-
<span class="cline-any cline-
|
|
584
|
-
<span class="cline-any cline-
|
|
583
|
+
<span class="cline-any cline-no"> </span>
|
|
584
|
+
<span class="cline-any cline-no"> </span>
|
|
585
585
|
<span class="cline-any cline-neutral"> </span>
|
|
586
586
|
<span class="cline-any cline-neutral"> </span>
|
|
587
|
-
<span class="cline-any cline-
|
|
588
|
-
<span class="cline-any cline-
|
|
587
|
+
<span class="cline-any cline-no"> </span>
|
|
588
|
+
<span class="cline-any cline-no"> </span>
|
|
589
589
|
<span class="cline-any cline-neutral"> </span>
|
|
590
|
-
<span class="cline-any cline-
|
|
591
|
-
<span class="cline-any cline-
|
|
592
|
-
<span class="cline-any cline-
|
|
593
|
-
<span class="cline-any cline-
|
|
590
|
+
<span class="cline-any cline-no"> </span>
|
|
591
|
+
<span class="cline-any cline-no"> </span>
|
|
592
|
+
<span class="cline-any cline-no"> </span>
|
|
593
|
+
<span class="cline-any cline-no"> </span>
|
|
594
594
|
<span class="cline-any cline-neutral"> </span>
|
|
595
595
|
<span class="cline-any cline-neutral"> </span>
|
|
596
|
-
<span class="cline-any cline-
|
|
597
|
-
<span class="cline-any cline-
|
|
598
|
-
<span class="cline-any cline-
|
|
596
|
+
<span class="cline-any cline-no"> </span>
|
|
597
|
+
<span class="cline-any cline-no"> </span>
|
|
598
|
+
<span class="cline-any cline-no"> </span>
|
|
599
599
|
<span class="cline-any cline-neutral"> </span>
|
|
600
600
|
<span class="cline-any cline-neutral"> </span>
|
|
601
|
-
<span class="cline-any cline-
|
|
601
|
+
<span class="cline-any cline-no"> </span>
|
|
602
602
|
<span class="cline-any cline-neutral"> </span>
|
|
603
603
|
<span class="cline-any cline-neutral"> </span>
|
|
604
|
-
<span class="cline-any cline-
|
|
605
|
-
<span class="cline-any cline-
|
|
606
|
-
<span class="cline-any cline-
|
|
607
|
-
<span class="cline-any cline-
|
|
608
|
-
<span class="cline-any cline-
|
|
609
|
-
<span class="cline-any cline-
|
|
604
|
+
<span class="cline-any cline-no"> </span>
|
|
605
|
+
<span class="cline-any cline-no"> </span>
|
|
606
|
+
<span class="cline-any cline-no"> </span>
|
|
607
|
+
<span class="cline-any cline-no"> </span>
|
|
608
|
+
<span class="cline-any cline-no"> </span>
|
|
609
|
+
<span class="cline-any cline-no"> </span>
|
|
610
610
|
<span class="cline-any cline-neutral"> </span>
|
|
611
611
|
<span class="cline-any cline-neutral"> </span>
|
|
612
612
|
<span class="cline-any cline-neutral"> </span>
|
|
613
613
|
<span class="cline-any cline-neutral"> </span>
|
|
614
614
|
<span class="cline-any cline-neutral"> </span>
|
|
615
|
-
<span class="cline-any cline-
|
|
616
|
-
<span class="cline-any cline-
|
|
617
|
-
<span class="cline-any cline-
|
|
618
|
-
<span class="cline-any cline-
|
|
619
|
-
<span class="cline-any cline-
|
|
615
|
+
<span class="cline-any cline-no"> </span>
|
|
616
|
+
<span class="cline-any cline-no"> </span>
|
|
617
|
+
<span class="cline-any cline-no"> </span>
|
|
618
|
+
<span class="cline-any cline-no"> </span>
|
|
619
|
+
<span class="cline-any cline-no"> </span>
|
|
620
620
|
<span class="cline-any cline-neutral"> </span>
|
|
621
|
-
<span class="cline-any cline-
|
|
621
|
+
<span class="cline-any cline-no"> </span>
|
|
622
622
|
<span class="cline-any cline-neutral"> </span>
|
|
623
|
-
<span class="cline-any cline-
|
|
623
|
+
<span class="cline-any cline-no"> </span>
|
|
624
624
|
<span class="cline-any cline-neutral"> </span>
|
|
625
625
|
<span class="cline-any cline-neutral"> </span>
|
|
626
|
-
<span class="cline-any cline-
|
|
626
|
+
<span class="cline-any cline-no"> </span>
|
|
627
627
|
<span class="cline-any cline-neutral"> </span>
|
|
628
628
|
<span class="cline-any cline-neutral"> </span>
|
|
629
|
-
<span class="cline-any cline-
|
|
629
|
+
<span class="cline-any cline-no"> </span>
|
|
630
630
|
<span class="cline-any cline-neutral"> </span>
|
|
631
|
-
<span class="cline-any cline-
|
|
632
|
-
<span class="cline-any cline-
|
|
631
|
+
<span class="cline-any cline-no"> </span>
|
|
632
|
+
<span class="cline-any cline-no"> </span>
|
|
633
633
|
<span class="cline-any cline-neutral"> </span>
|
|
634
|
-
<span class="cline-any cline-
|
|
635
|
-
<span class="cline-any cline-
|
|
636
|
-
<span class="cline-any cline-
|
|
634
|
+
<span class="cline-any cline-no"> </span>
|
|
635
|
+
<span class="cline-any cline-no"> </span>
|
|
636
|
+
<span class="cline-any cline-no"> </span>
|
|
637
637
|
<span class="cline-any cline-neutral"> </span>
|
|
638
638
|
<span class="cline-any cline-neutral"> </span>
|
|
639
|
-
<span class="cline-any cline-
|
|
640
|
-
<span class="cline-any cline-
|
|
639
|
+
<span class="cline-any cline-no"> </span>
|
|
640
|
+
<span class="cline-any cline-no"> </span>
|
|
641
641
|
<span class="cline-any cline-neutral"> </span>
|
|
642
|
-
<span class="cline-any cline-
|
|
643
|
-
<span class="cline-any cline-
|
|
644
|
-
<span class="cline-any cline-
|
|
642
|
+
<span class="cline-any cline-no"> </span>
|
|
643
|
+
<span class="cline-any cline-no"> </span>
|
|
644
|
+
<span class="cline-any cline-no"> </span>
|
|
645
645
|
<span class="cline-any cline-neutral"> </span>
|
|
646
646
|
<span class="cline-any cline-neutral"> </span>
|
|
647
|
-
<span class="cline-any cline-
|
|
647
|
+
<span class="cline-any cline-no"> </span>
|
|
648
648
|
<span class="cline-any cline-neutral"> </span>
|
|
649
649
|
<span class="cline-any cline-neutral"> </span>
|
|
650
|
-
<span class="cline-any cline-
|
|
651
|
-
<span class="cline-any cline-
|
|
650
|
+
<span class="cline-any cline-no"> </span>
|
|
651
|
+
<span class="cline-any cline-no"> </span>
|
|
652
652
|
<span class="cline-any cline-neutral"> </span>
|
|
653
653
|
<span class="cline-any cline-neutral"> </span>
|
|
654
654
|
<span class="cline-any cline-neutral"> </span>
|
|
655
|
-
<span class="cline-any cline-
|
|
656
|
-
<span class="cline-any cline-
|
|
657
|
-
<span class="cline-any cline-
|
|
658
|
-
<span class="cline-any cline-
|
|
659
|
-
<span class="cline-any cline-
|
|
655
|
+
<span class="cline-any cline-no"> </span>
|
|
656
|
+
<span class="cline-any cline-no"> </span>
|
|
657
|
+
<span class="cline-any cline-no"> </span>
|
|
658
|
+
<span class="cline-any cline-no"> </span>
|
|
659
|
+
<span class="cline-any cline-no"> </span>
|
|
660
660
|
<span class="cline-any cline-neutral"> </span>
|
|
661
661
|
<span class="cline-any cline-neutral"> </span>
|
|
662
|
-
<span class="cline-any cline-
|
|
662
|
+
<span class="cline-any cline-no"> </span>
|
|
663
663
|
<span class="cline-any cline-no"> </span>
|
|
664
664
|
<span class="cline-any cline-neutral"> </span>
|
|
665
|
-
<span class="cline-any cline-
|
|
666
|
-
<span class="cline-any cline-
|
|
667
|
-
<span class="cline-any cline-
|
|
665
|
+
<span class="cline-any cline-no"> </span>
|
|
666
|
+
<span class="cline-any cline-no"> </span>
|
|
667
|
+
<span class="cline-any cline-no"> </span>
|
|
668
668
|
<span class="cline-any cline-neutral"> </span>
|
|
669
669
|
<span class="cline-any cline-neutral"> </span>
|
|
670
670
|
<span class="cline-any cline-neutral"> </span>
|
|
671
671
|
<span class="cline-any cline-neutral"> </span>
|
|
672
|
-
<span class="cline-any cline-
|
|
672
|
+
<span class="cline-any cline-no"> </span>
|
|
673
673
|
<span class="cline-any cline-neutral"> </span>
|
|
674
|
-
<span class="cline-any cline-
|
|
675
|
-
<span class="cline-any cline-
|
|
676
|
-
<span class="cline-any cline-
|
|
677
|
-
<span class="cline-any cline-
|
|
678
|
-
<span class="cline-any cline-
|
|
679
|
-
<span class="cline-any cline-
|
|
680
|
-
<span class="cline-any cline-
|
|
681
|
-
<span class="cline-any cline-
|
|
682
|
-
<span class="cline-any cline-
|
|
683
|
-
<span class="cline-any cline-
|
|
674
|
+
<span class="cline-any cline-no"> </span>
|
|
675
|
+
<span class="cline-any cline-no"> </span>
|
|
676
|
+
<span class="cline-any cline-no"> </span>
|
|
677
|
+
<span class="cline-any cline-no"> </span>
|
|
678
|
+
<span class="cline-any cline-no"> </span>
|
|
679
|
+
<span class="cline-any cline-no"> </span>
|
|
680
|
+
<span class="cline-any cline-no"> </span>
|
|
681
|
+
<span class="cline-any cline-no"> </span>
|
|
682
|
+
<span class="cline-any cline-no"> </span>
|
|
683
|
+
<span class="cline-any cline-no"> </span>
|
|
684
684
|
<span class="cline-any cline-neutral"> </span>
|
|
685
|
-
<span class="cline-any cline-
|
|
685
|
+
<span class="cline-any cline-no"> </span>
|
|
686
686
|
<span class="cline-any cline-neutral"> </span>
|
|
687
|
-
<span class="cline-any cline-
|
|
687
|
+
<span class="cline-any cline-no"> </span>
|
|
688
688
|
<span class="cline-any cline-neutral"> </span>
|
|
689
|
-
<span class="cline-any cline-
|
|
689
|
+
<span class="cline-any cline-no"> </span>
|
|
690
690
|
<span class="cline-any cline-neutral"> </span>
|
|
691
|
-
<span class="cline-any cline-
|
|
692
|
-
<span class="cline-any cline-
|
|
693
|
-
<span class="cline-any cline-
|
|
694
|
-
<span class="cline-any cline-
|
|
691
|
+
<span class="cline-any cline-no"> </span>
|
|
692
|
+
<span class="cline-any cline-no"> </span>
|
|
693
|
+
<span class="cline-any cline-no"> </span>
|
|
694
|
+
<span class="cline-any cline-no"> </span>
|
|
695
695
|
<span class="cline-any cline-neutral"> </span>
|
|
696
696
|
<span class="cline-any cline-neutral"> </span>
|
|
697
|
-
<span class="cline-any cline-
|
|
698
|
-
<span class="cline-any cline-
|
|
699
|
-
<span class="cline-any cline-
|
|
700
|
-
<span class="cline-any cline-
|
|
697
|
+
<span class="cline-any cline-no"> </span>
|
|
698
|
+
<span class="cline-any cline-no"> </span>
|
|
699
|
+
<span class="cline-any cline-no"> </span>
|
|
700
|
+
<span class="cline-any cline-no"> </span>
|
|
701
701
|
<span class="cline-any cline-neutral"> </span>
|
|
702
702
|
<span class="cline-any cline-neutral"> </span>
|
|
703
703
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -705,21 +705,21 @@
|
|
|
705
705
|
<span class="cline-any cline-neutral"> </span>
|
|
706
706
|
<span class="cline-any cline-neutral"> </span>
|
|
707
707
|
<span class="cline-any cline-neutral"> </span>
|
|
708
|
-
<span class="cline-any cline-
|
|
708
|
+
<span class="cline-any cline-no"> </span>
|
|
709
709
|
<span class="cline-any cline-neutral"> </span>
|
|
710
710
|
<span class="cline-any cline-neutral"> </span>
|
|
711
711
|
<span class="cline-any cline-neutral"> </span>
|
|
712
712
|
<span class="cline-any cline-neutral"> </span>
|
|
713
|
-
<span class="cline-any cline-
|
|
714
|
-
<span class="cline-any cline-
|
|
715
|
-
<span class="cline-any cline-
|
|
716
|
-
<span class="cline-any cline-
|
|
713
|
+
<span class="cline-any cline-no"> </span>
|
|
714
|
+
<span class="cline-any cline-no"> </span>
|
|
715
|
+
<span class="cline-any cline-no"> </span>
|
|
716
|
+
<span class="cline-any cline-no"> </span>
|
|
717
717
|
<span class="cline-any cline-neutral"> </span>
|
|
718
|
-
<span class="cline-any cline-
|
|
719
|
-
<span class="cline-any cline-
|
|
720
|
-
<span class="cline-any cline-
|
|
718
|
+
<span class="cline-any cline-no"> </span>
|
|
719
|
+
<span class="cline-any cline-no"> </span>
|
|
720
|
+
<span class="cline-any cline-no"> </span>
|
|
721
721
|
<span class="cline-any cline-neutral"> </span>
|
|
722
|
-
<span class="cline-any cline-
|
|
722
|
+
<span class="cline-any cline-no"> </span>
|
|
723
723
|
<span class="cline-any cline-neutral"> </span>
|
|
724
724
|
<span class="cline-any cline-neutral"> </span>
|
|
725
725
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -733,8 +733,8 @@
|
|
|
733
733
|
<span class="cline-any cline-neutral"> </span>
|
|
734
734
|
<span class="cline-any cline-neutral"> </span>
|
|
735
735
|
<span class="cline-any cline-neutral"> </span>
|
|
736
|
-
<span class="cline-any cline-
|
|
737
|
-
<span class="cline-any cline-
|
|
736
|
+
<span class="cline-any cline-no"> </span>
|
|
737
|
+
<span class="cline-any cline-no"> </span>
|
|
738
738
|
<span class="cline-any cline-neutral"> </span>
|
|
739
739
|
<span class="cline-any cline-neutral"> </span>
|
|
740
740
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -772,17 +772,17 @@ import { objectifyIDs } from '../db'
|
|
|
772
772
|
import { hasServiceAbilities, hasResourceAbilities, getQueryForAbilities, Roles, RoleNames, countSubjectsForResource } from '../../common/permissions'
|
|
773
773
|
import { isTagEqual } from './hooks.tags'
|
|
774
774
|
|
|
775
|
-
const debug = makeDebug('kdk:core:authorisations:hooks')
|
|
775
|
+
const debug = <span class="cstat-no" title="statement not covered" >makeDebug('kdk:core:authorisations:hooks')</span>
|
|
776
776
|
|
|
777
|
-
export function createJWT (options = {}) {
|
|
778
|
-
return
|
|
779
|
-
const defaults =
|
|
780
|
-
const user = _.get(hook, 'params.user')
|
|
781
|
-
let items = getItems(hook)
|
|
782
|
-
const isArray = Array.isArray(items)
|
|
783
|
-
|
|
777
|
+
export function <span class="fstat-no" title="function not covered" >createJWT </span>(options = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> {
|
|
778
|
+
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >as</span>ync function (hook) {</span>
|
|
779
|
+
const defaults = <span class="cstat-no" title="statement not covered" >hook.app.get('authentication') || hook.app.get('auth')</span>
|
|
780
|
+
const user = <span class="cstat-no" title="statement not covered" >_.get(hook, 'params.user')</span>
|
|
781
|
+
let items = <span class="cstat-no" title="statement not covered" >getItems(hook)</span>
|
|
782
|
+
const isArray = <span class="cstat-no" title="statement not covered" >Array.isArray(items)</span>
|
|
783
|
+
<span class="cstat-no" title="statement not covered" > items = (isArray ? items : [items])</span>
|
|
784
784
|
// Generate access tokens for all items
|
|
785
|
-
const accessTokens = await Promise.all(items.map(
|
|
785
|
+
const accessTokens = <span class="cstat-no" title="statement not covered" >await Promise.all(items.map(<span class="fstat-no" title="function not covered" >it</span>em => <span class="cstat-no" title="statement not covered" >hook.app.passport.createJWT(</span></span>
|
|
786
786
|
// Provided function can be used to pick or omit properties in JWT payload
|
|
787
787
|
(typeof options.payload === 'function' ? options.payload(user) : {}),
|
|
788
788
|
// Provided function can be used for custom options cdepending on the user,
|
|
@@ -790,76 +790,76 @@ export function createJWT (options = {}) {
|
|
|
790
790
|
_.merge({}, defaults, (typeof options.jwt === 'function' ? { jwt: options.jwt(user) } : options)))
|
|
791
791
|
))
|
|
792
792
|
// Store access token on items
|
|
793
|
-
items.forEach((
|
|
794
|
-
|
|
795
|
-
return hook
|
|
793
|
+
<span class="cstat-no" title="statement not covered" > items.forEach(<span class="fstat-no" title="function not covered" >(i</span>tem, index) => <span class="cstat-no" title="statement not covered" >_.set(item, options.name || 'accessToken', accessTokens[index]))</span></span>
|
|
794
|
+
<span class="cstat-no" title="statement not covered" > replaceItems(hook, isArray ? items : items[0])</span>
|
|
795
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
|
|
799
|
-
export function populateSubjects (hook) {
|
|
800
|
-
|
|
801
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
799
|
+
export function <span class="fstat-no" title="function not covered" >populateSubjects </span>(hook) {
|
|
800
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
801
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'populateSubjects\' hook should only be used as a \'before\' hook.')</span>
|
|
802
802
|
}
|
|
803
803
|
|
|
804
|
-
return populateObjects({ serviceField: 'subjectsService', idField: 'subjects', throwOnNotFound: true })(hook)
|
|
804
|
+
<span class="cstat-no" title="statement not covered" > return populateObjects({ serviceField: 'subjectsService', idField: 'subjects', throwOnNotFound: true })(hook)</span>
|
|
805
805
|
}
|
|
806
806
|
|
|
807
|
-
export function <span class="fstat-no" title="function not covered" >unpopulateSubjects
|
|
807
|
+
export function <span class="fstat-no" title="function not covered" >unpopulateSubjects </span>(hook) {
|
|
808
808
|
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
809
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
809
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'unpopulateSubjects\' hook should only be used as a \'after\' hook.')</span>
|
|
810
810
|
}
|
|
811
811
|
|
|
812
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
812
|
+
<span class="cstat-no" title="statement not covered" > return unpopulateObjects({ serviceField: 'subjectsService', idField: 'subjects' })(hook)</span>
|
|
813
813
|
}
|
|
814
814
|
|
|
815
|
-
export function populateResource (hook) {
|
|
816
|
-
|
|
817
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
815
|
+
export function <span class="fstat-no" title="function not covered" >populateResource </span>(hook) {
|
|
816
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
817
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'populateResource\' hook should only be used as a \'before\' hook.')</span>
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
-
return populateObject({ serviceField: 'resourcesService', idField: 'resource', throwOnNotFound: true })(hook)
|
|
820
|
+
<span class="cstat-no" title="statement not covered" > return populateObject({ serviceField: 'resourcesService', idField: 'resource', throwOnNotFound: true })(hook)</span>
|
|
821
821
|
}
|
|
822
822
|
|
|
823
|
-
export function <span class="fstat-no" title="function not covered" >unpopulateResource
|
|
823
|
+
export function <span class="fstat-no" title="function not covered" >unpopulateResource </span>(hook) {
|
|
824
824
|
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
825
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
825
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'unpopulateResource\' hook should only be used as a \'after\' hook.')</span>
|
|
826
826
|
}
|
|
827
827
|
|
|
828
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
828
|
+
<span class="cstat-no" title="statement not covered" > return unpopulateObject({ serviceField: 'resourcesService', idField: 'resource' })(hook)</span>
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
-
export function preventEscalation (hook) {
|
|
832
|
-
|
|
833
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
831
|
+
export function <span class="fstat-no" title="function not covered" >preventEscalation </span>(hook) {
|
|
832
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
833
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'preventEscalation\' hook should only be used as a \'before\' hook.')</span>
|
|
834
834
|
}
|
|
835
835
|
|
|
836
|
-
const params = hook.params
|
|
836
|
+
const params = <span class="cstat-no" title="statement not covered" >hook.params</span>
|
|
837
837
|
// If called internally we skip authorisation
|
|
838
|
-
let checkEscalation = _.has(params, 'provider')
|
|
839
|
-
|
|
838
|
+
let checkEscalation = <span class="cstat-no" title="statement not covered" >_.has(params, 'provider')</span>
|
|
839
|
+
<span class="cstat-no" title="statement not covered" > debug('Escalation check ' + (checkEscalation ? 'enabled' : 'disabled') + ' for provider')</span>
|
|
840
840
|
// If explicitely asked to perform/skip, override defaults
|
|
841
|
-
if (_.has(params, 'checkEscalation')) {
|
|
842
|
-
checkEscalation = params.checkEscalation
|
|
843
|
-
debug('Escalation check ' + (checkEscalation ? 'forced' :
|
|
841
|
+
<span class="cstat-no" title="statement not covered" > if (_.has(params, 'checkEscalation')) {</span>
|
|
842
|
+
<span class="cstat-no" title="statement not covered" > checkEscalation = params.checkEscalation</span>
|
|
843
|
+
<span class="cstat-no" title="statement not covered" > debug('Escalation check ' + (checkEscalation ? 'forced' : 'unforced'))</span>
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
if (checkEscalation) {
|
|
847
|
-
const user = params.user
|
|
846
|
+
<span class="cstat-no" title="statement not covered" > if (checkEscalation) {</span>
|
|
847
|
+
const user = <span class="cstat-no" title="statement not covered" >params.user</span>
|
|
848
848
|
// Make hook usable on remove as well
|
|
849
|
-
const data = hook.data || {}
|
|
849
|
+
const data = <span class="cstat-no" title="statement not covered" >hook.data || {}</span>
|
|
850
850
|
// Make hook usable with query params as well
|
|
851
|
-
const query = params.query || {}
|
|
852
|
-
const scopeName = data.scope || query.scope
|
|
851
|
+
const query = <span class="cstat-no" title="statement not covered" >params.query || {}</span>
|
|
852
|
+
const scopeName = <span class="cstat-no" title="statement not covered" >data.scope || query.scope </span>// Get scope name first
|
|
853
853
|
// Retrieve the right scope on the user
|
|
854
|
-
const scope = _.get(user, scopeName, [])
|
|
854
|
+
const scope = <span class="cstat-no" title="statement not covered" >_.get(user, scopeName, [])</span>
|
|
855
855
|
// Then the target resource
|
|
856
|
-
const resource = _.find(scope,
|
|
856
|
+
const resource = <span class="cstat-no" title="statement not covered" >_.find(scope, <span class="fstat-no" title="function not covered" >re</span>source => <span class="cstat-no" title="statement not covered" >resource._id && (resource._id.toString() === params.resource._id.toString()))</span></span>
|
|
857
857
|
// Then user permission level
|
|
858
|
-
const permissions = (
|
|
859
|
-
const role = (
|
|
860
|
-
|
|
861
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
862
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
858
|
+
const permissions = (<span class="cstat-no" title="statement not covered" >resource ? resource.permissions : undefined)</span>
|
|
859
|
+
const role = (<span class="cstat-no" title="statement not covered" >permissions ? Roles[permissions] : undefined)</span>
|
|
860
|
+
<span class="cstat-no" title="statement not covered" > if (_.isUndefined(role)) {</span>
|
|
861
|
+
<span class="cstat-no" title="statement not covered" > debug('Role for authorisation not found on user for scope ' + scopeName)</span>
|
|
862
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to change authorisation on resource')</span>
|
|
863
863
|
}
|
|
864
864
|
|
|
865
865
|
// Check if privilege escalation might occur, if so clamp to user permission level
|
|
@@ -869,188 +869,188 @@ export function preventEscalation (hook) {
|
|
|
869
869
|
// (e.g. cannot change a owner into a manager when you are a manager)
|
|
870
870
|
// - on remove you should not be able to remove permissions on others having higher permissions than yourself
|
|
871
871
|
// (e.g. cannot remove a owner when you are a manager)
|
|
872
|
-
const subjects = params.subjects.filter(
|
|
873
|
-
const subjectScope = _.get(subject, scopeName, [])
|
|
874
|
-
const subjectResource = _.find(subjectScope,
|
|
875
|
-
const subjectPermissions = (
|
|
876
|
-
const subjectRole = (
|
|
877
|
-
const hasRole =
|
|
878
|
-
if (hook.method === 'create') {
|
|
879
|
-
return (!hasRole || (subjectRole <= role))
|
|
872
|
+
const subjects = <span class="cstat-no" title="statement not covered" >params.subjects.filter(<span class="fstat-no" title="function not covered" >su</span>bject => {</span>
|
|
873
|
+
const subjectScope = <span class="cstat-no" title="statement not covered" >_.get(subject, scopeName, [])</span>
|
|
874
|
+
const subjectResource = <span class="cstat-no" title="statement not covered" >_.find(subjectScope, <span class="fstat-no" title="function not covered" >re</span>source => <span class="cstat-no" title="statement not covered" >resource._id && (resource._id.toString() === params.resource._id.toString()))</span></span>
|
|
875
|
+
const subjectPermissions = (<span class="cstat-no" title="statement not covered" >subjectResource ? subjectResource.permissions : undefined)</span>
|
|
876
|
+
const subjectRole = (<span class="cstat-no" title="statement not covered" >subjectPermissions ? Roles[subjectPermissions] : undefined)</span>
|
|
877
|
+
const hasRole = <span class="cstat-no" title="statement not covered" >!_.isUndefined(subjectRole)</span>
|
|
878
|
+
<span class="cstat-no" title="statement not covered" > if (hook.method === 'create') {</span>
|
|
879
|
+
<span class="cstat-no" title="statement not covered" > return (!hasRole || (subjectRole <= role)) </span>// The first time no authorisation can be found
|
|
880
880
|
} else {
|
|
881
|
-
return (hasRole && (subjectRole <= role))
|
|
881
|
+
<span class="cstat-no" title="statement not covered" > return (hasRole && (subjectRole <= role)) </span>// Authorisation must be found on remove
|
|
882
882
|
}
|
|
883
883
|
})
|
|
884
|
-
if (subjects.length < params.subjects.length) {
|
|
885
|
-
debug(`${(params.subjects.length - subjects.length)} subjects with higher permissions level found for scope ${scopeName}`)
|
|
886
|
-
throw new Forbidden('You are not allowed to change authorisation on subject(s)')
|
|
884
|
+
<span class="cstat-no" title="statement not covered" > if (subjects.length < params.subjects.length) {</span>
|
|
885
|
+
<span class="cstat-no" title="statement not covered" > debug(`${(params.subjects.length - subjects.length)} subjects with higher permissions level found for scope ${scopeName}`)</span>
|
|
886
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to change authorisation on subject(s)')</span>
|
|
887
887
|
}
|
|
888
888
|
// Input permissions needs to be checked since:
|
|
889
889
|
// - you should not be able to give higher permissions than your own ones to others
|
|
890
890
|
// (e.g. cannot create a owner when you are a manager)
|
|
891
891
|
let authorisationRole
|
|
892
|
-
if (data.permissions) {
|
|
893
|
-
authorisationRole = Roles[data.permissions]
|
|
894
|
-
} else <span class="
|
|
895
|
-
<span class="cstat-no" title="statement not covered" > authorisationRole =
|
|
892
|
+
<span class="cstat-no" title="statement not covered" > if (data.permissions) {</span>
|
|
893
|
+
<span class="cstat-no" title="statement not covered" > authorisationRole = Roles[data.permissions]</span>
|
|
894
|
+
} else <span class="cstat-no" title="statement not covered" >if (query.permissions) {</span>
|
|
895
|
+
<span class="cstat-no" title="statement not covered" > authorisationRole = Roles[query.permissions]</span>
|
|
896
896
|
}
|
|
897
|
-
if (!_.isUndefined(authorisationRole)) {
|
|
898
|
-
|
|
899
|
-
debug('Cannot escalate with higher permissions level for scope ' + scopeName)
|
|
900
|
-
throw new Forbidden('You are not allowed to change authorisation on resource')
|
|
897
|
+
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(authorisationRole)) {</span>
|
|
898
|
+
<span class="cstat-no" title="statement not covered" > if (authorisationRole > role) {</span>
|
|
899
|
+
<span class="cstat-no" title="statement not covered" > debug('Cannot escalate with higher permissions level for scope ' + scopeName)</span>
|
|
900
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to change authorisation on resource')</span>
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
|
|
905
|
-
return hook
|
|
905
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
906
906
|
}
|
|
907
907
|
|
|
908
|
-
export async function authorise (hook) {
|
|
909
|
-
|
|
910
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
908
|
+
export async function <span class="fstat-no" title="function not covered" >authorise </span>(hook) {
|
|
909
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
910
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'authorise\' hook should only be used as a \'before\' hook.')</span>
|
|
911
911
|
}
|
|
912
|
-
const operation = hook.method
|
|
913
|
-
const resourceType = hook.service.name
|
|
914
|
-
debug('Provider is', hook.params.provider)
|
|
915
|
-
if (hook.params.user) debug('User is', hook.params.user)
|
|
916
|
-
debug('Operation is', operation)
|
|
917
|
-
if (resourceType) debug('Resource type is', resourceType)
|
|
912
|
+
const operation = <span class="cstat-no" title="statement not covered" >hook.method</span>
|
|
913
|
+
const resourceType = <span class="cstat-no" title="statement not covered" >hook.service.name</span>
|
|
914
|
+
<span class="cstat-no" title="statement not covered" > debug('Provider is', hook.params.provider)</span>
|
|
915
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.user) <span class="cstat-no" title="statement not covered" >debug('User is', hook.params.user)</span></span>
|
|
916
|
+
<span class="cstat-no" title="statement not covered" > debug('Operation is', operation)</span>
|
|
917
|
+
<span class="cstat-no" title="statement not covered" > if (resourceType) <span class="cstat-no" title="statement not covered" >debug('Resource type is', resourceType)</span></span>
|
|
918
918
|
|
|
919
919
|
// If called internally we skip authorisation
|
|
920
|
-
let checkAuthorisation = _.has(hook.params, 'provider')
|
|
921
|
-
debug('Access check ' + (checkAuthorisation ? 'enabled' : 'disabled') + ' for provider')
|
|
920
|
+
let checkAuthorisation = <span class="cstat-no" title="statement not covered" >_.has(hook.params, 'provider')</span>
|
|
921
|
+
<span class="cstat-no" title="statement not covered" > debug('Access check ' + (checkAuthorisation ? 'enabled' : 'disabled') + ' for provider')</span>
|
|
922
922
|
// If already checked we skip authorisation
|
|
923
|
-
if (hook.params.authorised) {
|
|
924
|
-
debug('Access already granted')
|
|
925
|
-
checkAuthorisation = false
|
|
923
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.authorised) {</span>
|
|
924
|
+
<span class="cstat-no" title="statement not covered" > debug('Access already granted')</span>
|
|
925
|
+
<span class="cstat-no" title="statement not covered" > checkAuthorisation = false</span>
|
|
926
926
|
}
|
|
927
927
|
// We also skip authorisation for built-in Feathers services like authentication
|
|
928
|
-
if (typeof hook.service.getPath !== 'function') {
|
|
929
|
-
debug('Access disabled on built-in services')
|
|
930
|
-
checkAuthorisation = false
|
|
928
|
+
<span class="cstat-no" title="statement not covered" > if (typeof hook.service.getPath !== 'function') {</span>
|
|
929
|
+
<span class="cstat-no" title="statement not covered" > debug('Access disabled on built-in services')</span>
|
|
930
|
+
<span class="cstat-no" title="statement not covered" > checkAuthorisation = false</span>
|
|
931
931
|
}
|
|
932
932
|
// If explicitely asked to perform/skip, override defaults
|
|
933
|
-
if (_.has(hook.params, 'checkAuthorisation')) {
|
|
934
|
-
checkAuthorisation = _.get(hook.params, 'checkAuthorisation')
|
|
933
|
+
<span class="cstat-no" title="statement not covered" > if (_.has(hook.params, 'checkAuthorisation')) {</span>
|
|
934
|
+
<span class="cstat-no" title="statement not covered" > checkAuthorisation = _.get(hook.params, 'checkAuthorisation')</span>
|
|
935
935
|
// Bypass authorisation for next hooks otherwise we will loop infinitely
|
|
936
|
-
delete hook.params.checkAuthorisation
|
|
937
|
-
debug('Access check ' + (checkAuthorisation ? 'forced' : 'unforced'))
|
|
936
|
+
<span class="cstat-no" title="statement not covered" > delete hook.params.checkAuthorisation</span>
|
|
937
|
+
<span class="cstat-no" title="statement not covered" > debug('Access check ' + (checkAuthorisation ? 'forced' : 'unforced'))</span>
|
|
938
938
|
}
|
|
939
939
|
|
|
940
|
-
const context = hook.service.context
|
|
941
|
-
if (checkAuthorisation) {
|
|
940
|
+
const context = <span class="cstat-no" title="statement not covered" >hook.service.context</span>
|
|
941
|
+
<span class="cstat-no" title="statement not covered" > if (checkAuthorisation) {</span>
|
|
942
942
|
// Build ability for user
|
|
943
|
-
const authorisationService = hook.app.getService('authorisations')
|
|
944
|
-
const abilities = await authorisationService.getAbilities(hook.params.user)
|
|
945
|
-
hook.params.abilities = abilities
|
|
946
|
-
debug('User abilities are', abilities.rules)
|
|
943
|
+
const authorisationService = <span class="cstat-no" title="statement not covered" >hook.app.getService('authorisations')</span>
|
|
944
|
+
const abilities = <span class="cstat-no" title="statement not covered" >await authorisationService.getAbilities(hook.params.user)</span>
|
|
945
|
+
<span class="cstat-no" title="statement not covered" > hook.params.abilities = abilities</span>
|
|
946
|
+
<span class="cstat-no" title="statement not covered" > debug('User abilities are', abilities.rules)</span>
|
|
947
947
|
|
|
948
948
|
// Check for access to service fisrt
|
|
949
|
-
if (!hasServiceAbilities(abilities, hook.service)) {
|
|
950
|
-
debug('Service access not granted')
|
|
951
|
-
throw new Forbidden(`You are not allowed to access service ${hook.service.getPath()}`)
|
|
949
|
+
<span class="cstat-no" title="statement not covered" > if (!hasServiceAbilities(abilities, hook.service)) {</span>
|
|
950
|
+
<span class="cstat-no" title="statement not covered" > debug('Service access not granted')</span>
|
|
951
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to access service ${hook.service.getPath()}`)</span>
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
-
if (!hook.id) {
|
|
954
|
+
<span class="cstat-no" title="statement not covered" > if (!hook.id) {</span>
|
|
955
955
|
// In this specific case there is no query to be run,
|
|
956
956
|
// simply check against the object we'd like to create
|
|
957
|
-
if (operation === 'create') {
|
|
958
|
-
const resource = hook.data
|
|
959
|
-
debug('Target resource is ', resource)
|
|
960
|
-
if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) {
|
|
961
|
-
debug('Resource access not granted')
|
|
962
|
-
throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)
|
|
957
|
+
<span class="cstat-no" title="statement not covered" > if (operation === 'create') {</span>
|
|
958
|
+
const resource = <span class="cstat-no" title="statement not covered" >hook.data</span>
|
|
959
|
+
<span class="cstat-no" title="statement not covered" > debug('Target resource is ', resource)</span>
|
|
960
|
+
<span class="cstat-no" title="statement not covered" > if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) {</span>
|
|
961
|
+
<span class="cstat-no" title="statement not covered" > debug('Resource access not granted')</span>
|
|
962
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)</span>
|
|
963
963
|
}
|
|
964
964
|
} else {
|
|
965
965
|
// When we find/update/patch/remove multiple items this ensures that
|
|
966
966
|
// only the ones authorised by constraints on the resources will be fetched
|
|
967
967
|
// This avoid fetching all first then check it one by one
|
|
968
|
-
const dbQuery = objectifyIDs(getQueryForAbilities(abilities, operation, resourceType))
|
|
969
|
-
if (dbQuery) {
|
|
970
|
-
hook.params.query = _.transform(hook.params.query, (
|
|
971
|
-
|
|
972
|
-
else result[key] = value
|
|
968
|
+
const dbQuery = <span class="cstat-no" title="statement not covered" >objectifyIDs(getQueryForAbilities(abilities, operation, resourceType))</span>
|
|
969
|
+
<span class="cstat-no" title="statement not covered" > if (dbQuery) {</span>
|
|
970
|
+
<span class="cstat-no" title="statement not covered" > hook.params.query = _.transform(hook.params.query, <span class="fstat-no" title="function not covered" >(r</span>esult, value, key) => {</span>
|
|
971
|
+
<span class="cstat-no" title="statement not covered" > if (key === '$or') <span class="cstat-no" title="statement not covered" >result.$and = [{ $or: value }]</span></span>
|
|
972
|
+
else <span class="cstat-no" title="statement not covered" >result[key] = value</span>
|
|
973
973
|
}, {})
|
|
974
|
-
_.merge(hook.params.query, dbQuery)
|
|
974
|
+
<span class="cstat-no" title="statement not covered" > _.merge(hook.params.query, dbQuery)</span>
|
|
975
975
|
} else {
|
|
976
|
-
hook.result = { total: 0, skip: 0, data: [] }
|
|
976
|
+
<span class="cstat-no" title="statement not covered" > hook.result = { total: 0, skip: 0, data: [] }</span>
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
debug('Resource access granted')
|
|
979
|
+
<span class="cstat-no" title="statement not covered" > debug('Resource access granted')</span>
|
|
980
980
|
// Some specific services might not expose a get function, in this case we cannot check for authorisation
|
|
981
981
|
// this has to be implemented by the service itself
|
|
982
|
-
} else if (typeof hook.service.get === 'function') {
|
|
982
|
+
} else <span class="cstat-no" title="statement not covered" >if (typeof hook.service.get === 'function') {</span>
|
|
983
983
|
// In this case (single get/update/patch/remove) we need to fetch the item first
|
|
984
|
-
const resource = await hook.service.get(hook.id, Object.assign({ checkAuthorisation: false }, hook.params))
|
|
985
|
-
debug('Target resource is', resource)
|
|
984
|
+
const resource = <span class="cstat-no" title="statement not covered" >await hook.service.get(hook.id, Object.assign({ checkAuthorisation: false }, hook.params))</span>
|
|
985
|
+
<span class="cstat-no" title="statement not covered" > debug('Target resource is', resource)</span>
|
|
986
986
|
// Then check against the object we'd like to manage
|
|
987
|
-
if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) {
|
|
988
|
-
debug('Resource access not granted')
|
|
989
|
-
throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)
|
|
987
|
+
<span class="cstat-no" title="statement not covered" > if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) {</span>
|
|
988
|
+
<span class="cstat-no" title="statement not covered" > debug('Resource access not granted')</span>
|
|
989
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)</span>
|
|
990
990
|
}
|
|
991
991
|
// Avoid fetching again the object in this case
|
|
992
|
-
if (operation === 'get') {
|
|
993
|
-
hook.result = resource
|
|
992
|
+
<span class="cstat-no" title="statement not covered" > if (operation === 'get') {</span>
|
|
993
|
+
<span class="cstat-no" title="statement not covered" > hook.result = resource</span>
|
|
994
994
|
}
|
|
995
|
-
hook.params.authorised = true
|
|
996
|
-
debug('Resource access granted')
|
|
997
|
-
return hook
|
|
995
|
+
<span class="cstat-no" title="statement not covered" > hook.params.authorised = true</span>
|
|
996
|
+
<span class="cstat-no" title="statement not covered" > debug('Resource access granted')</span>
|
|
997
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
998
998
|
}
|
|
999
999
|
} else {
|
|
1000
|
-
debug('Authorisation check skipped, access granted')
|
|
1000
|
+
<span class="cstat-no" title="statement not covered" > debug('Authorisation check skipped, access granted')</span>
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
|
-
hook.params.authorised = true
|
|
1004
|
-
return hook
|
|
1003
|
+
<span class="cstat-no" title="statement not covered" > hook.params.authorised = true</span>
|
|
1004
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1005
1005
|
}
|
|
1006
1006
|
|
|
1007
|
-
export function updateAbilities (options = {}) {
|
|
1008
|
-
return
|
|
1009
|
-
const app = hook.app
|
|
1010
|
-
const params = hook.params
|
|
1011
|
-
const authorisationService = app.getService('authorisations')
|
|
1012
|
-
let subject = (
|
|
1007
|
+
export function <span class="fstat-no" title="function not covered" >updateAbilities </span>(options = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> {
|
|
1008
|
+
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >as</span>ync function (hook) {</span>
|
|
1009
|
+
const app = <span class="cstat-no" title="statement not covered" >hook.app</span>
|
|
1010
|
+
const params = <span class="cstat-no" title="statement not covered" >hook.params</span>
|
|
1011
|
+
const authorisationService = <span class="cstat-no" title="statement not covered" >app.getService('authorisations')</span>
|
|
1012
|
+
let subject = (<span class="cstat-no" title="statement not covered" >options.subjectAsItem ? getItems(hook) : params.user)</span>
|
|
1013
1013
|
// We might not have all information required eg on patch to compute new abilities,
|
|
1014
1014
|
// in this case we have to fetch the whole subject
|
|
1015
|
-
|
|
1016
|
-
<span class="cstat-no" title="statement not covered" > subject =
|
|
1015
|
+
<span class="cstat-no" title="statement not covered" > if (options.fetchSubject) {</span>
|
|
1016
|
+
<span class="cstat-no" title="statement not covered" > subject = await hook.service.get(subject._id.toString())</span>
|
|
1017
1017
|
}
|
|
1018
|
-
const abilities = await authorisationService.updateAbilities(subject)
|
|
1019
|
-
debug('Abilities updated on subject', subject, abilities.rules)
|
|
1020
|
-
return hook
|
|
1018
|
+
const abilities = <span class="cstat-no" title="statement not covered" >await authorisationService.updateAbilities(subject)</span>
|
|
1019
|
+
<span class="cstat-no" title="statement not covered" > debug('Abilities updated on subject', subject, abilities.rules)</span>
|
|
1020
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
|
-
export function preventRemovingLastOwner (resourceScope) {
|
|
1025
|
-
return
|
|
1024
|
+
export function <span class="fstat-no" title="function not covered" >preventRemovingLastOwner </span>(resourceScope) {
|
|
1025
|
+
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >as</span>ync function (hook) {</span>
|
|
1026
1026
|
// By pass check ?
|
|
1027
|
-
|
|
1028
|
-
const params = hook.params
|
|
1029
|
-
const data = hook.data || {}
|
|
1030
|
-
const query = params.query || {}
|
|
1031
|
-
const scope = data.scope || query.scope
|
|
1032
|
-
const grantedPermissions = data.permissions || query.permissions
|
|
1033
|
-
const grantedRole = (grantedPermissions ? Roles[grantedPermissions] : undefined)
|
|
1034
|
-
const resource = hook.params.resource
|
|
1035
|
-
const subjects = hook.params.subjects
|
|
1036
|
-
const subjectService = hook.params.subjectsService
|
|
1027
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.force) <span class="cstat-no" title="statement not covered" >return hook</span></span>
|
|
1028
|
+
const params = <span class="cstat-no" title="statement not covered" >hook.params</span>
|
|
1029
|
+
const data = <span class="cstat-no" title="statement not covered" >hook.data || {}</span>
|
|
1030
|
+
const query = <span class="cstat-no" title="statement not covered" >params.query || {}</span>
|
|
1031
|
+
const scope = <span class="cstat-no" title="statement not covered" >data.scope || query.scope</span>
|
|
1032
|
+
const grantedPermissions = <span class="cstat-no" title="statement not covered" >data.permissions || query.permissions</span>
|
|
1033
|
+
const grantedRole = (<span class="cstat-no" title="statement not covered" >grantedPermissions ? Roles[grantedPermissions] : undefined)</span>
|
|
1034
|
+
const resource = <span class="cstat-no" title="statement not covered" >hook.params.resource</span>
|
|
1035
|
+
const subjects = <span class="cstat-no" title="statement not covered" >hook.params.subjects</span>
|
|
1036
|
+
const subjectService = <span class="cstat-no" title="statement not covered" >hook.params.subjectsService</span>
|
|
1037
1037
|
// On create check if we try to downgrade permissions otherwise let pass through
|
|
1038
|
-
if (!_.isUndefined(grantedRole) && (grantedRole === Roles.owner)) return hook
|
|
1038
|
+
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(grantedRole) && (grantedRole === Roles.owner)) <span class="cstat-no" title="statement not covered" >return hook</span></span>
|
|
1039
1039
|
|
|
1040
|
-
if ((scope === resourceScope) && resource && resource._id) {
|
|
1040
|
+
<span class="cstat-no" title="statement not covered" > if ((scope === resourceScope) && resource && resource._id) {</span>
|
|
1041
1041
|
// Count existing owners
|
|
1042
|
-
const owners = await countSubjectsForResource(subjectService, resourceScope, resource._id, Roles.owner)
|
|
1042
|
+
const owners = <span class="cstat-no" title="statement not covered" >await countSubjectsForResource(subjectService, resourceScope, resource._id, Roles.owner)</span>
|
|
1043
1043
|
// Now count owners we change/remove permissions on
|
|
1044
|
-
const removedOwners = subjects.reduce((
|
|
1045
|
-
const resources = _.get(subject, resourceScope, [])
|
|
1046
|
-
const ownedResource = _.find(resources, { _id: resource._id, permissions: RoleNames[Roles.owner] })
|
|
1047
|
-
return (ownedResource ? count + 1 : count)
|
|
1044
|
+
const removedOwners = <span class="cstat-no" title="statement not covered" >subjects.reduce(<span class="fstat-no" title="function not covered" >(c</span>ount, subject) => {</span>
|
|
1045
|
+
const resources = <span class="cstat-no" title="statement not covered" >_.get(subject, resourceScope, [])</span>
|
|
1046
|
+
const ownedResource = <span class="cstat-no" title="statement not covered" >_.find(resources, { _id: resource._id, permissions: RoleNames[Roles.owner] })</span>
|
|
1047
|
+
<span class="cstat-no" title="statement not covered" > return (ownedResource ? count + 1 : count)</span>
|
|
1048
1048
|
}, 0)
|
|
1049
1049
|
// If none remains stop
|
|
1050
|
-
if (removedOwners >= owners.total) {
|
|
1051
|
-
debug('Cannot remove the last owner of resource ', resource)
|
|
1052
|
-
const resourceName =
|
|
1053
|
-
throw new Forbidden('You are not allowed to remove the last owner of resource ' + resourceName, {
|
|
1050
|
+
<span class="cstat-no" title="statement not covered" > if (removedOwners >= owners.total) {</span>
|
|
1051
|
+
<span class="cstat-no" title="statement not covered" > debug('Cannot remove the last owner of resource ', resource)</span>
|
|
1052
|
+
const resourceName = <span class="cstat-no" title="statement not covered" >resource.name ? resource.name : resource._id.toString()</span>
|
|
1053
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to remove the last owner of resource ' + resourceName, {</span>
|
|
1054
1054
|
translation: {
|
|
1055
1055
|
key: 'CANNOT_REMOVE_LAST_OWNER',
|
|
1056
1056
|
params: { resource: resourceName }
|
|
@@ -1058,21 +1058,21 @@ export function preventRemovingLastOwner (resourceScope) {
|
|
|
1058
1058
|
})
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
return hook
|
|
1061
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
1065
|
-
export async function removeOrganisationGroupsAuthorisations (hook) {
|
|
1066
|
-
const app = hook.app
|
|
1067
|
-
const authorisationService = app.getService('authorisations')
|
|
1068
|
-
const org = hook.params.resource
|
|
1069
|
-
const user = hook.params.user
|
|
1065
|
+
export async function <span class="fstat-no" title="function not covered" >removeOrganisationGroupsAuthorisations </span>(hook) {
|
|
1066
|
+
const app = <span class="cstat-no" title="statement not covered" >hook.app</span>
|
|
1067
|
+
const authorisationService = <span class="cstat-no" title="statement not covered" >app.getService('authorisations')</span>
|
|
1068
|
+
const org = <span class="cstat-no" title="statement not covered" >hook.params.resource</span>
|
|
1069
|
+
const user = <span class="cstat-no" title="statement not covered" >hook.params.user</span>
|
|
1070
1070
|
// Unset membership for the all org groups
|
|
1071
|
-
const orgGroupService = app.getService('groups', org)
|
|
1072
|
-
const groups = await orgGroupService.find({ paginate: false })
|
|
1073
|
-
await Promise.all(groups.map(
|
|
1071
|
+
const orgGroupService = <span class="cstat-no" title="statement not covered" >app.getService('groups', org)</span>
|
|
1072
|
+
const groups = <span class="cstat-no" title="statement not covered" >await orgGroupService.find({ paginate: false })</span>
|
|
1073
|
+
<span class="cstat-no" title="statement not covered" > await Promise.all(groups.map(<span class="fstat-no" title="function not covered" >gr</span>oup => {</span>
|
|
1074
1074
|
// Unset membership on group for the all org users
|
|
1075
|
-
return authorisationService.remove(group._id.toString(), {
|
|
1075
|
+
<span class="cstat-no" title="statement not covered" > return authorisationService.remove(group._id.toString(), {</span>
|
|
1076
1076
|
query: {
|
|
1077
1077
|
scope: 'groups'
|
|
1078
1078
|
},
|
|
@@ -1086,35 +1086,35 @@ export async function removeOrganisationGroupsAuthorisations (hook) {
|
|
|
1086
1086
|
resourcesService: orgGroupService
|
|
1087
1087
|
})
|
|
1088
1088
|
}))
|
|
1089
|
-
debug('Authorisations unset on groups for organisation ' + org._id)
|
|
1090
|
-
return hook
|
|
1089
|
+
<span class="cstat-no" title="statement not covered" > debug('Authorisations unset on groups for organisation ' + org._id)</span>
|
|
1090
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
|
-
export <span class="fstat-no" title="function not covered" >
|
|
1093
|
+
export async function <span class="fstat-no" title="function not covered" >removeOrganisationTagsAuthorisations </span>(hook) {
|
|
1094
1094
|
const app = <span class="cstat-no" title="statement not covered" >hook.app</span>
|
|
1095
1095
|
const org = <span class="cstat-no" title="statement not covered" >hook.params.resource</span>
|
|
1096
1096
|
const subjectService = <span class="cstat-no" title="statement not covered" >hook.params.subjectsService</span>
|
|
1097
|
-
const orgTagsService = <span class="cstat-no" title="statement not covered" >app.
|
|
1097
|
+
const orgTagsService = <span class="cstat-no" title="statement not covered" >app.getService('tags', org)</span>
|
|
1098
1098
|
const subjects = <span class="cstat-no" title="statement not covered" >hook.params.subjects || []</span>
|
|
1099
|
-
<span class="cstat-no" title="statement not covered" > if (subjects.length === 0) <span class="cstat-no" title="statement not covered" >return
|
|
1099
|
+
<span class="cstat-no" title="statement not covered" > if (subjects.length === 0) <span class="cstat-no" title="statement not covered" >return hook</span></span>
|
|
1100
1100
|
// Retrieve org tags
|
|
1101
|
-
const orgTags = <span class="cstat-no" title="statement not covered" >await orgTagsService.
|
|
1101
|
+
const orgTags = <span class="cstat-no" title="statement not covered" >await orgTagsService.find({ paginate: false })</span>
|
|
1102
1102
|
const promises = <span class="cstat-no" title="statement not covered" >[]</span>
|
|
1103
|
-
<span class="cstat-no" title="statement not covered" > subjects.
|
|
1103
|
+
<span class="cstat-no" title="statement not covered" > subjects.forEach(<span class="fstat-no" title="function not covered" >su</span>bject => {</span>
|
|
1104
1104
|
const tags = <span class="cstat-no" title="statement not covered" >subject.tags || []</span>
|
|
1105
1105
|
// Find tags from org
|
|
1106
|
-
const fromOrg = <span class="cstat-no" title="statement not covered" >_.
|
|
1106
|
+
const fromOrg = <span class="cstat-no" title="statement not covered" >_.intersectionWith(tags, orgTags, isTagEqual)</span>
|
|
1107
1107
|
// Clear removed tags
|
|
1108
|
-
const notFromOrg = <span class="cstat-no" title="statement not covered" >_.
|
|
1108
|
+
const notFromOrg = <span class="cstat-no" title="statement not covered" >_.differenceWith(tags, orgTags, isTagEqual)</span>
|
|
1109
1109
|
// Update subject if required
|
|
1110
1110
|
<span class="cstat-no" title="statement not covered" > if (fromOrg.length > 0) {</span>
|
|
1111
|
-
<span class="cstat-no" title="statement not covered" > promises.
|
|
1111
|
+
<span class="cstat-no" title="statement not covered" > promises.push(subjectService.patch(subject._id.toString(), { tags: notFromOrg, devices: subject.devices }))</span>
|
|
1112
1112
|
}
|
|
1113
1113
|
})
|
|
1114
1114
|
// Perform subject updates in parallel
|
|
1115
|
-
<span class="cstat-no" title="statement not covered" > await
|
|
1116
|
-
<span class="cstat-no" title="statement not covered" > debug(
|
|
1117
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
1115
|
+
<span class="cstat-no" title="statement not covered" > await Promise.all(promises)</span>
|
|
1116
|
+
<span class="cstat-no" title="statement not covered" > debug(`Tags unset on ${promises.length} subjects for organisation ` + org._id)</span>
|
|
1117
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1118
1118
|
}
|
|
1119
1119
|
</pre></td></tr></table></pre>
|
|
1120
1120
|
|
|
@@ -1123,7 +1123,7 @@ export <span class="fstat-no" title="function not covered" >async function r</sp
|
|
|
1123
1123
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1124
1124
|
Code coverage generated by
|
|
1125
1125
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
1126
|
-
at Fri
|
|
1126
|
+
at Fri Jan 07 2022 19:29:57 GMT+0100 (GMT+01:00)
|
|
1127
1127
|
</div>
|
|
1128
1128
|
</div>
|
|
1129
1129
|
<script src="../../../prettify.js"></script>
|