@kalisio/kdk 2.5.3 → 2.6.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/.github/workflows/main.yaml +35 -6
- package/.vscode/settings.json +5 -0
- package/client.globe.js +8 -0
- package/client.js +8 -0
- package/client.map.js +8 -0
- package/core/api/hooks/hooks.push.js +3 -2
- package/core/api/hooks/hooks.tags.js +56 -0
- package/core/api/models/tags.model.mongodb.js +8 -0
- package/core/api/services/index.js +33 -2
- package/core/api/services/tags/tags.hooks.js +47 -0
- package/core/client/api.js +5 -5
- package/core/client/components/KActivity.vue +3 -2
- package/core/client/components/KChip.vue +2 -2
- package/core/client/components/KEditor.vue +3 -1
- package/core/client/components/KFollower.vue +4 -4
- package/core/client/components/KStore.vue +1 -1
- package/core/client/components/KTab.vue +20 -7
- package/core/client/components/account/KProfile.vue +9 -25
- package/core/client/components/action/KAction.vue +10 -10
- package/core/client/components/action/KToggleFullscreenAction.vue +2 -11
- package/core/client/components/app/KHome.vue +3 -2
- package/core/client/components/collection/KFilter.vue +5 -4
- package/core/client/components/collection/KGrid.vue +5 -1
- package/core/client/components/collection/KItemsFilter.vue +47 -0
- package/core/client/components/collection/KItemsSorter.vue +42 -0
- package/core/client/components/collection/KScrollDown.vue +2 -2
- package/core/client/components/collection/KSearchFilterControl.vue +3 -2
- package/core/client/components/collection/KSorter.vue +33 -37
- package/core/client/components/collection/KTagsFilterControl.vue +14 -40
- package/core/client/components/collection/KTagsFilterView.vue +10 -45
- package/core/client/components/collection/KTimeFilterControl.vue +6 -7
- package/core/client/components/collection/KTimeFilterView.vue +13 -22
- package/core/client/components/collection/KTimeLine.vue +18 -9
- package/core/client/components/form/KColorField.vue +13 -6
- package/core/client/components/form/KColorScaleField.vue +7 -12
- package/core/client/components/form/KFileField.vue +118 -89
- package/core/client/components/form/KForm.vue +30 -18
- package/core/client/components/form/KIconField.vue +4 -1
- package/core/client/components/form/KNumberField.vue +9 -2
- package/core/client/components/form/KSelectField.vue +1 -4
- package/core/client/components/form/KTagField.vue +229 -0
- package/core/client/components/form/KTextField.vue +4 -0
- package/core/client/components/form/KTextareaField.vue +3 -1
- package/core/client/components/input/KShapePicker.vue +3 -3
- package/core/client/components/layout/KFab.vue +32 -20
- package/core/client/components/layout/KPage.vue +11 -6
- package/core/client/components/layout/KWindow.vue +6 -1
- package/core/client/components/media/index.js +2 -6
- package/core/client/components/menu/KMenu.vue +12 -10
- package/core/client/components/menu/KSubMenu.vue +12 -12
- package/core/client/components/messages/KMessageCard.vue +13 -12
- package/core/client/components/messages/KMessageComposer.vue +13 -9
- package/core/client/components/messages/KMessagesTimeLine.vue +16 -8
- package/core/client/components/tags/KTagFilter.vue +99 -0
- package/core/client/components/tags/KTagItem.vue +65 -0
- package/core/client/components/tags/KTagManager.vue +198 -0
- package/core/client/components/tags/KTagSelection.vue +82 -0
- package/core/client/components/time/KDate.vue +3 -17
- package/core/client/components/time/KDateTime.vue +1 -1
- package/core/client/components/time/KTime.vue +0 -4
- package/core/client/composables/collection-filter.js +41 -2
- package/core/client/composables/collection.js +3 -3
- package/core/client/composables/index.js +1 -0
- package/core/client/composables/pwa.js +13 -0
- package/core/client/composables/session.js +7 -8
- package/core/client/composables/user.js +36 -0
- package/core/client/directives/index.js +1 -0
- package/core/client/directives/v-drop-file.js +174 -0
- package/core/client/document.js +2 -1
- package/core/client/exporter.js +17 -3
- package/core/client/i18n/core_en.json +34 -7
- package/core/client/i18n/core_fr.json +36 -9
- package/core/client/i18n.js +26 -11
- package/core/client/layout.js +5 -5
- package/core/client/mixins/mixin.base-activity.js +8 -5
- package/core/client/mixins/mixin.base-editor.js +2 -1
- package/core/client/mixins/mixin.base-field.js +3 -2
- package/core/client/mixins/mixin.base-item.js +12 -10
- package/core/client/mixins/mixin.service.js +3 -1
- package/core/client/platform.js +0 -3
- package/core/client/readers/reader.json.js +2 -2
- package/core/client/utils/index.js +2 -0
- package/core/client/utils/utils.collection.js +6 -6
- package/core/client/utils/utils.colors.js +473 -173
- package/core/client/utils/utils.files.js +19 -0
- package/core/client/utils/utils.locale.js +13 -17
- package/core/client/utils/utils.services.js +27 -0
- package/core/client/utils/utils.shapes.js +2 -2
- package/core/client/utils/utils.tags.js +17 -0
- package/core/client/utils/utils.tours.js +31 -0
- package/core/common/permissions.js +3 -0
- package/core/common/schemas/tags.update.json +35 -0
- package/core/common/schemas/users.update-profile.json +1 -1
- package/core/common/utils.js +5 -5
- package/coverage/core/api/application.js.html +464 -464
- package/coverage/core/api/authentication.js.html +219 -351
- package/coverage/core/api/db.js.html +194 -209
- package/coverage/core/api/hooks/hooks.authentication.js.html +208 -34
- package/coverage/core/api/hooks/hooks.authorisations.js.html +717 -432
- package/coverage/core/api/hooks/hooks.groups.js.html +52 -52
- package/coverage/core/api/hooks/hooks.logger.js.html +43 -43
- package/coverage/core/api/hooks/hooks.model.js.html +300 -312
- package/coverage/core/api/hooks/hooks.organisations.js.html +264 -264
- package/coverage/core/api/hooks/hooks.push.js.html +107 -119
- package/coverage/core/api/hooks/hooks.query.js.html +279 -279
- package/coverage/core/api/hooks/hooks.schemas.js.html +135 -135
- package/coverage/core/api/hooks/hooks.service.js.html +28 -28
- package/coverage/core/api/hooks/hooks.storage.js.html +7 -7
- package/coverage/core/api/hooks/hooks.users.js.html +478 -205
- package/coverage/core/api/hooks/index.html +132 -102
- package/coverage/core/api/hooks/index.js.html +19 -13
- package/coverage/core/api/index.html +69 -54
- package/coverage/core/api/index.js.html +25 -25
- package/coverage/core/api/marshall.js.html +127 -127
- package/coverage/core/api/models/groups.model.mongodb.js.html +26 -26
- package/coverage/core/api/models/index.html +66 -21
- package/coverage/core/api/models/messages.model.mongodb.js.html +27 -39
- package/coverage/core/api/models/organisations.model.mongodb.js.html +16 -16
- package/coverage/core/api/models/tags.model.mongodb.js.html +30 -30
- package/coverage/core/api/models/users.model.mongodb.js.html +11 -11
- package/coverage/core/api/services/account/account.hooks.js.html +46 -46
- package/coverage/core/api/services/account/account.service.js.html +139 -139
- package/coverage/core/api/services/account/index.html +22 -22
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +34 -34
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +230 -221
- package/coverage/core/api/services/authorisations/index.html +20 -20
- package/coverage/core/api/services/databases/databases.hooks.js.html +1 -1
- package/coverage/core/api/services/databases/databases.service.js.html +1 -1
- package/coverage/core/api/services/databases/index.html +1 -1
- package/coverage/core/api/services/groups/groups.hooks.js.html +72 -72
- package/coverage/core/api/services/groups/index.html +21 -21
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +76 -76
- package/coverage/core/api/services/import-export/import-export.service.js.html +32 -32
- package/coverage/core/api/services/import-export/index.html +32 -32
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +195 -171
- package/coverage/core/api/services/mailer/index.html +32 -32
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +80 -80
- package/coverage/core/api/services/mailer/mailer.service.js.html +32 -32
- package/coverage/core/api/services/messages/index.html +21 -21
- package/coverage/core/api/services/messages/messages.hooks.js.html +76 -94
- package/coverage/core/api/services/organisations/index.html +32 -32
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +72 -72
- package/coverage/core/api/services/organisations/organisations.service.js.html +163 -163
- package/coverage/core/api/services/push/index.html +32 -32
- package/coverage/core/api/services/push/push.hooks.js.html +80 -80
- package/coverage/core/api/services/push/push.service.js.html +34 -34
- package/coverage/core/api/services/storage/index.html +29 -29
- package/coverage/core/api/services/storage/storage.hooks.js.html +80 -80
- package/coverage/core/api/services/storage/storage.service.js.html +37 -37
- package/coverage/core/api/services/tags/index.html +21 -21
- package/coverage/core/api/services/tags/tags.hooks.js.html +72 -72
- package/coverage/core/api/services/users/index.html +12 -27
- package/coverage/core/api/services/users/users.hooks.js.html +84 -87
- package/coverage/core/api/utils.js.html +1 -1
- package/coverage/core/common/errors.js.html +2 -2
- package/coverage/core/common/index.html +32 -47
- package/coverage/core/common/index.js.html +11 -11
- package/coverage/core/common/permissions.js.html +579 -264
- package/coverage/core/common/schema.js.html +26 -26
- package/coverage/core/common/utils.js.html +59 -65
- package/coverage/index.html +286 -256
- package/coverage/lcov-report/core/api/application.js.html +464 -464
- package/coverage/lcov-report/core/api/authentication.js.html +219 -351
- package/coverage/lcov-report/core/api/db.js.html +194 -209
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +208 -34
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +717 -432
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +52 -52
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +43 -43
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +300 -312
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +264 -264
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +107 -119
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +279 -279
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +135 -135
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +28 -28
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +7 -7
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +478 -205
- package/coverage/lcov-report/core/api/hooks/index.html +132 -102
- package/coverage/lcov-report/core/api/hooks/index.js.html +19 -13
- package/coverage/lcov-report/core/api/index.html +69 -54
- package/coverage/lcov-report/core/api/index.js.html +25 -25
- package/coverage/lcov-report/core/api/marshall.js.html +127 -127
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +26 -26
- package/coverage/lcov-report/core/api/models/index.html +66 -21
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +27 -39
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +16 -16
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +30 -30
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +11 -11
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +46 -46
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +139 -139
- package/coverage/lcov-report/core/api/services/account/index.html +22 -22
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +34 -34
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +230 -221
- package/coverage/lcov-report/core/api/services/authorisations/index.html +20 -20
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/databases/index.html +1 -1
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +72 -72
- package/coverage/lcov-report/core/api/services/groups/index.html +21 -21
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +76 -76
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +32 -32
- package/coverage/lcov-report/core/api/services/import-export/index.html +32 -32
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +195 -171
- package/coverage/lcov-report/core/api/services/mailer/index.html +32 -32
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +80 -80
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +32 -32
- package/coverage/lcov-report/core/api/services/messages/index.html +21 -21
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +76 -94
- package/coverage/lcov-report/core/api/services/organisations/index.html +32 -32
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +72 -72
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +163 -163
- package/coverage/lcov-report/core/api/services/push/index.html +32 -32
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +80 -80
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +34 -34
- package/coverage/lcov-report/core/api/services/storage/index.html +29 -29
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +80 -80
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +37 -37
- package/coverage/lcov-report/core/api/services/tags/index.html +21 -21
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +72 -72
- package/coverage/lcov-report/core/api/services/users/index.html +12 -27
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +84 -87
- package/coverage/lcov-report/core/api/utils.js.html +1 -1
- package/coverage/lcov-report/core/common/errors.js.html +2 -2
- package/coverage/lcov-report/core/common/index.html +32 -47
- package/coverage/lcov-report/core/common/index.js.html +11 -11
- package/coverage/lcov-report/core/common/permissions.js.html +579 -264
- package/coverage/lcov-report/core/common/schema.js.html +26 -26
- package/coverage/lcov-report/core/common/utils.js.html +59 -65
- package/coverage/lcov-report/index.html +286 -256
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +257 -353
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +218 -218
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +810 -795
- package/coverage/lcov-report/map/api/hooks/index.html +54 -54
- package/coverage/lcov-report/map/api/hooks/index.js.html +16 -16
- package/coverage/lcov-report/map/api/index.html +32 -32
- package/coverage/lcov-report/map/api/index.js.html +46 -46
- package/coverage/lcov-report/map/api/marshall.js.html +72 -72
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +24 -24
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +27 -69
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +80 -80
- package/coverage/lcov-report/map/api/models/index.html +54 -69
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +26 -26
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +136 -136
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +343 -343
- package/coverage/lcov-report/map/api/services/alerts/index.html +32 -32
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +160 -178
- package/coverage/lcov-report/map/api/services/catalog/index.html +21 -21
- 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 +114 -183
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +56 -359
- package/coverage/lcov-report/map/api/services/features/index.html +31 -31
- package/coverage/lcov-report/map/api/services/index.html +21 -21
- package/coverage/lcov-report/map/api/services/index.js.html +258 -495
- package/coverage/lcov-report/map/api/services/projects/index.html +21 -21
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +237 -237
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +68 -68
- package/coverage/lcov-report/map/common/errors.js.html +16 -16
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +267 -270
- package/coverage/lcov-report/map/common/grid.js.html +554 -554
- package/coverage/lcov-report/map/common/index.html +158 -158
- package/coverage/lcov-report/map/common/index.js.html +68 -68
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +73 -73
- package/coverage/lcov-report/map/common/moment-utils.js.html +18 -18
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +484 -484
- package/coverage/lcov-report/map/common/opendap-utils.js.html +353 -353
- package/coverage/lcov-report/map/common/permissions.js.html +36 -42
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +59 -59
- package/coverage/lcov-report/map/common/tms-utils.js.html +6 -6
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +190 -190
- package/coverage/lcov-report/map/common/wcs-utils.js.html +339 -339
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +345 -345
- package/coverage/lcov-report/map/common/wfs-utils.js.html +11 -11
- package/coverage/lcov-report/map/common/wms-utils.js.html +8 -8
- package/coverage/lcov-report/map/common/wmts-utils.js.html +7 -7
- package/coverage/lcov.info +7793 -8564
- package/coverage/map/api/hooks/hooks.catalog.js.html +257 -353
- package/coverage/map/api/hooks/hooks.features.js.html +218 -218
- package/coverage/map/api/hooks/hooks.query.js.html +810 -795
- package/coverage/map/api/hooks/index.html +54 -54
- package/coverage/map/api/hooks/index.js.html +16 -16
- package/coverage/map/api/index.html +32 -32
- package/coverage/map/api/index.js.html +46 -46
- package/coverage/map/api/marshall.js.html +72 -72
- package/coverage/map/api/models/alerts.model.mongodb.js.html +24 -24
- package/coverage/map/api/models/catalog.model.mongodb.js.html +27 -69
- package/coverage/map/api/models/features.model.mongodb.js.html +80 -80
- package/coverage/map/api/models/index.html +54 -69
- package/coverage/map/api/models/projects.model.mongodb.js.html +26 -26
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +136 -136
- package/coverage/map/api/services/alerts/alerts.service.js.html +343 -343
- package/coverage/map/api/services/alerts/index.html +32 -32
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +160 -178
- package/coverage/map/api/services/catalog/index.html +21 -21
- 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 +114 -183
- package/coverage/map/api/services/features/features.service.js.html +56 -359
- package/coverage/map/api/services/features/index.html +31 -31
- package/coverage/map/api/services/index.html +21 -21
- package/coverage/map/api/services/index.js.html +258 -495
- package/coverage/map/api/services/projects/index.html +21 -21
- package/coverage/map/api/services/projects/projects.hooks.js.html +237 -237
- package/coverage/map/common/dynamic-grid-source.js.html +68 -68
- package/coverage/map/common/errors.js.html +16 -16
- package/coverage/map/common/geotiff-grid-source.js.html +267 -270
- package/coverage/map/common/grid.js.html +554 -554
- package/coverage/map/common/index.html +158 -158
- package/coverage/map/common/index.js.html +68 -68
- package/coverage/map/common/meteo-model-grid-source.js.html +73 -73
- package/coverage/map/common/moment-utils.js.html +18 -18
- package/coverage/map/common/opendap-grid-source.js.html +484 -484
- package/coverage/map/common/opendap-utils.js.html +353 -353
- package/coverage/map/common/permissions.js.html +36 -42
- package/coverage/map/common/time-based-grid-source.js.html +59 -59
- package/coverage/map/common/tms-utils.js.html +6 -6
- package/coverage/map/common/wcs-grid-source.js.html +190 -190
- package/coverage/map/common/wcs-utils.js.html +339 -339
- package/coverage/map/common/weacast-grid-source.js.html +345 -345
- package/coverage/map/common/wfs-utils.js.html +11 -11
- package/coverage/map/common/wms-utils.js.html +8 -8
- package/coverage/map/common/wmts-utils.js.html +7 -7
- package/coverage/tmp/coverage-151166-1723543324307-0.json +1 -0
- package/coverage/tmp/coverage-151178-1723543324283-0.json +1 -0
- package/coverage/tmp/coverage-151189-1723543324271-0.json +1 -0
- package/coverage/tmp/coverage-151201-1723543324248-0.json +1 -0
- package/coverage/tmp/coverage-151208-1723543324227-0.json +1 -0
- package/extras/configs/panes.top.js +33 -11
- package/extras/configs/stickies.js +26 -16
- package/extras/configs/widgets.left.js +13 -1
- package/extras/libs/jsts.min.js +8 -0
- package/{test/client/core/account.js → extras/tests/core/account.mjs} +4 -4
- package/extras/tests/core/api.mjs +114 -0
- package/{test/client/core/collection.js → extras/tests/core/collection.mjs} +8 -8
- package/{test/client/core/dialogs.js → extras/tests/core/dialogs.mjs} +1 -1
- package/extras/tests/core/index.mjs +9 -0
- package/{test/client/core/layout.js → extras/tests/core/layout.mjs} +7 -3
- package/{test/client/core/runner.js → extras/tests/core/runner.mjs} +3 -3
- package/{test/client/core/screens.js → extras/tests/core/screens.mjs} +1 -1
- package/{test/client/core/utils.js → extras/tests/core/utils.mjs} +79 -26
- package/extras/tests/index.mjs +4 -0
- package/{test/client/map/api.js → extras/tests/map/api.mjs} +1 -1
- package/{test/client/map/catalog.js → extras/tests/map/catalog.mjs} +18 -18
- package/{test/client/map/controls.js → extras/tests/map/controls.mjs} +3 -3
- package/extras/tests/map/index.mjs +5 -0
- package/{test/client/map/time.js → extras/tests/map/time.mjs} +3 -3
- package/{test/client/map/utils.js → extras/tests/map/utils.mjs} +6 -5
- package/extras/tours/fab.js +36 -0
- package/extras/tours/layout.js +49 -0
- package/extras/tours/pane.left.js +78 -0
- package/extras/tours/pane.right.js +145 -0
- package/extras/tours/pane.top.js +239 -0
- package/map/api/config/layers.cjs +28 -13
- package/map/api/hooks/hooks.query.js +12 -7
- package/map/api/models/catalog.model.mongodb.js +17 -6
- package/map/api/services/catalog/catalog.hooks.js +1 -1
- package/map/api/services/index.js +18 -1
- package/map/client/cesium/utils/utils.cesium.js +25 -65
- package/map/client/cesium/utils/utils.features.js +1 -0
- package/map/client/cesium/utils/utils.geojson.js +1 -0
- package/map/client/cesium/utils/utils.style.js +7 -6
- package/map/client/components/KFeatureEditor.vue +3 -3
- package/map/client/components/KFeaturesChart.vue +4 -4
- package/map/client/components/KFeaturesFilterEditor.vue +19 -13
- package/map/client/components/KFeaturesFilterManager.vue +7 -4
- package/map/client/components/KFeaturesTable.vue +2 -2
- package/map/client/components/KLayerEditor.vue +6 -6
- package/map/client/components/KMeasureTool.vue +2 -1
- package/map/client/components/catalog/KBaseLayersSelector.vue +1 -1
- package/map/client/components/catalog/KCategoryItem.vue +15 -1
- package/map/client/components/catalog/KConnectLayer.vue +2 -2
- package/map/client/components/catalog/KCreateView.vue +3 -2
- package/map/client/components/catalog/KFilteredLayerItem.vue +26 -6
- package/map/client/components/catalog/KImportLayer.vue +6 -3
- package/map/client/components/catalog/KLayerCategories.vue +6 -6
- package/map/client/components/catalog/KLayerItem.vue +12 -2
- package/map/client/components/catalog/KLayersList.vue +180 -0
- package/map/client/components/catalog/KLayersPanel.vue +146 -36
- package/map/client/components/catalog/KLayersSelector.vue +96 -48
- package/map/client/components/catalog/KProjectEditor.vue +0 -9
- package/map/client/components/catalog/KProjectSelector.vue +3 -2
- package/map/client/components/catalog/KProjectsPanel.vue +23 -8
- package/map/client/components/catalog/KViewsPanel.vue +18 -8
- package/map/client/components/catalog/KWeatherLayersSelector.vue +3 -3
- package/map/client/components/form/KDirectionField.vue +3 -6
- package/map/client/components/form/KLayerCategoryField.vue +2 -2
- package/map/client/components/form/KOwsServiceField.vue +25 -24
- package/map/client/components/form/KSelectLayersField.vue +4 -4
- package/map/client/components/form/KSelectViewsField.vue +4 -4
- package/map/client/components/legend/KLayerLegend.vue +11 -2
- package/map/client/components/legend/KLegend.vue +44 -51
- package/map/client/components/location/KLocationCardSection.vue +6 -7
- package/map/client/components/location/KLocationMap.vue +23 -13
- package/map/client/components/stickies/KPosition.vue +5 -0
- package/map/client/components/stickies/KZoomControl.vue +70 -0
- package/map/client/components/styles/KLayerStyleAction.vue +59 -12
- package/map/client/components/styles/KStyleEditor.vue +71 -8
- package/map/client/components/styles/KStyleEditorSection.vue +82 -33
- package/map/client/components/styles/KStyleManager.vue +119 -59
- package/map/client/components/styles/KStylePreview.vue +9 -25
- package/map/client/components/styles/KStylePreviewItem.vue +22 -1
- package/map/client/components/tools/KSearchTool.vue +1 -1
- package/map/client/components/widget/KElevationProfile.vue +20 -17
- package/map/client/components/widget/KInformationBox.vue +5 -5
- package/map/client/components/widget/KMapillaryViewer.vue +2 -1
- package/map/client/components/widget/KTimeSeries.vue +11 -9
- package/map/client/globe.js +2 -0
- package/map/client/i18n/map_en.json +30 -7
- package/map/client/i18n/map_fr.json +30 -7
- package/map/client/leaflet/GradientPath.js +61 -24
- package/map/client/leaflet/ShapeMarker.js +12 -5
- package/map/client/leaflet/TiledMeshLayer.js +3 -3
- package/map/client/leaflet/utils/utils.geojson.js +66 -8
- package/map/client/leaflet/utils/utils.style.js +14 -15
- package/map/client/mixins/globe/mixin.base-globe.js +190 -34
- package/map/client/mixins/globe/mixin.file-layers.js +3 -0
- package/map/client/mixins/globe/mixin.geojson-layers.js +179 -31
- package/map/client/mixins/globe/mixin.opendap-layers.js +2 -1
- package/map/client/mixins/globe/mixin.style.js +23 -1
- package/map/client/mixins/globe/mixin.tooltip.js +14 -2
- package/map/client/mixins/map/mixin.base-map.js +156 -58
- package/map/client/mixins/map/mixin.edit-layers.js +18 -15
- package/map/client/mixins/map/mixin.geojson-layers.js +181 -106
- package/map/client/mixins/map/mixin.heatmap-layers.js +3 -2
- package/map/client/mixins/map/mixin.map-activity.js +6 -1
- package/map/client/mixins/map/mixin.mapillary-layers.js +2 -1
- package/map/client/mixins/map/mixin.pmtiles-layers.js +3 -3
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +3 -2
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +3 -2
- package/map/client/mixins/mixin.activity.js +199 -55
- package/map/client/mixins/mixin.context.js +11 -11
- package/map/client/mixins/mixin.feature-service.js +11 -9
- package/map/client/mixins/mixin.weacast.js +5 -3
- package/map/client/readers/reader.geojson.js +3 -1
- package/map/client/utils/utils.capture.js +3 -3
- package/map/client/utils/utils.catalog.js +9 -5
- package/map/client/utils/utils.features.js +120 -54
- package/map/client/utils/utils.js +25 -10
- package/map/client/utils/utils.layers.js +148 -24
- package/map/client/utils/utils.location.js +26 -9
- package/map/client/utils/utils.schema.js +2 -1
- package/map/client/utils/utils.style.js +53 -9
- package/map/common/geotiff-grid-source.js +1 -3
- package/map/common/opendap-utils.js +0 -1
- package/map/common/tms-utils.js +0 -1
- package/map/common/wcs-utils.js +0 -1
- package/map/common/wfs-utils.js +0 -1
- package/map/common/wms-utils.js +7 -1
- package/map/common/wmts-utils.js +0 -1
- package/package.json +12 -12
- package/scripts/init_runner.sh +3 -3
- package/scripts/kash/CHANGELOG.md +27 -0
- package/scripts/kash/kash.sh +556 -237
- package/scripts/kash/scripts/run_tests.sh +44 -5
- package/scripts/setup_workspace.sh +23 -13
- package/test/api/core/config/default.cjs +2 -1
- package/test/api/core/tags.test.js +62 -0
- package/test/api/core/test-log-2024-04-22.log +84 -0
- package/test/api/core/{test-log-2025-02-05.log → test-log-2024-04-23.log} +3 -3
- package/test/api/core/test-log-2024-08-13.log +3 -0
- package/test/api/map/config/default.cjs +2 -1
- package/test/api/map/config/layers.json +9 -0
- package/test/api/map/data/openradiation.json +13811 -0
- package/test/api/map/grid-sources.test.js +1 -3
- package/test/api/map/index.test.js +60 -1
- package/test/api/map/style.test.js +30 -1
- package/test/api/map/test-log-2025-03-08.log +0 -0
- package/test.api.js +1 -1
- package/vite/App.vue +18 -0
- package/vite/AppWithGlobe.vue +84 -0
- package/vite/GlobeActivity.vue +58 -0
- package/vite/MapActivity.vue +63 -0
- package/vite/MapActivityWithGlobe.vue +63 -0
- package/vite/README.md +169 -0
- package/vite/config.js +221 -0
- package/vite/index_with_globe.html +50 -0
- package/vite/index_with_map.html +50 -0
- package/vite/package.json +173 -0
- package/vite/quasar.variables.scss +17 -0
- package/vite/vite.config.js +166 -0
- package/vite/yarn.lock +11641 -0
- package/core/client/components/media/KImageViewer.vue +0 -68
- package/core/client/components/media/KMarkdownViewer.vue +0 -55
- package/core/client/components/media/KMediaBrowser.vue +0 -301
- package/coverage/core/api/services/users/users.service.js.html +0 -100
- package/coverage/core/common/utils.offline.js.html +0 -199
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +0 -100
- package/coverage/lcov-report/core/common/utils.offline.js.html +0 -199
- package/coverage/lcov-report/map/api/models/styles.model.mongodb.js.html +0 -112
- package/coverage/lcov-report/map/api/services/styles/index.html +0 -116
- package/coverage/lcov-report/map/api/services/styles/styles.hooks.js.html +0 -196
- package/coverage/map/api/models/styles.model.mongodb.js.html +0 -112
- package/coverage/map/api/services/styles/index.html +0 -116
- package/coverage/map/api/services/styles/styles.hooks.js.html +0 -196
- package/coverage/tmp/coverage-151198-1753351220086-0.json +0 -1
- package/coverage/tmp/coverage-151210-1753351220070-0.json +0 -1
- package/coverage/tmp/coverage-151221-1753351129816-0.json +0 -1
- package/coverage/tmp/coverage-151233-1753351129803-0.json +0 -1
- package/coverage/tmp/coverage-151240-1753351129770-0.json +0 -1
- package/coverage/tmp/coverage-151307-1753351220058-0.json +0 -1
- package/coverage/tmp/coverage-151319-1753351220044-0.json +0 -1
- package/coverage/tmp/coverage-151326-1753351220010-0.json +0 -1
- package/extras/tours/core/account-profile.js +0 -32
- package/extras/tours/core/account.js +0 -143
- package/extras/tours/core/add-member.js +0 -75
- package/extras/tours/core/add-tag.js +0 -13
- package/extras/tours/core/create-group.js +0 -19
- package/extras/tours/core/create-organisation.js +0 -19
- package/extras/tours/core/create-tag.js +0 -26
- package/extras/tours/core/edit-member-role.js +0 -13
- package/extras/tours/core/groups.js +0 -65
- package/extras/tours/core/join-group.js +0 -13
- package/extras/tours/core/login.js +0 -41
- package/extras/tours/core/members.js +0 -108
- package/extras/tours/core/register.js +0 -61
- package/extras/tours/core/send-reset-password.js +0 -14
- package/extras/tours/core/tags.js +0 -65
- package/extras/tours/map/catalog-panel.js +0 -112
- package/extras/tours/map/fab.js +0 -26
- package/extras/tours/map/navigation-bar.js +0 -187
- package/extras/tours/map/side-nav.js +0 -36
- package/test/api/core/test-log-2025-05-21.log +0 -15
- package/test/api/core/test-log-2025-06-25.log +0 -9
- package/test/api/core/test-log-2025-07-24.log +0 -44
- package/test/api/map/test-log-2025-05-27.log +0 -13
- package/test/api/map/test-log-2025-06-23.log +0 -7
- package/test/api/map/test-log-2025-07-24.log +0 -11
- package/test/client/core/api.js +0 -361
- package/test/client/core/index.js +0 -9
- package/test/client/index.js +0 -4
- package/test/client/map/index.js +0 -5
- package/test.client.js +0 -1
- /package/{test/client/core/time.js → extras/tests/core/time.mjs} +0 -0
- /package/extras/tours/{map/add-layer.js → add-layer.js} +0 -0
- /package/extras/tours/{map/catalog-categories.js → catalog-categories.js} +0 -0
- /package/extras/tours/{map/connect-layer.js → connect-layer.js} +0 -0
- /package/extras/tours/{map/create-layer.js → create-layer.js} +0 -0
- /package/extras/tours/{map/create-view.js → create-view.js} +0 -0
- /package/extras/tours/{map/import-layer.js → import-layer.js} +0 -0
- /package/extras/tours/{map/timeline.js → pane.bottom.js} +0 -0
|
@@ -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">15.28% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>59/386</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">78.57% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>11/14</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">18.18% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>2/11</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">15.28% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>59/386</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -354,24 +354,118 @@
|
|
|
354
354
|
<a name='L289'></a><a href='#L289'>289</a>
|
|
355
355
|
<a name='L290'></a><a href='#L290'>290</a>
|
|
356
356
|
<a name='L291'></a><a href='#L291'>291</a>
|
|
357
|
-
<a name='L292'></a><a href='#L292'>292</a
|
|
358
|
-
<
|
|
359
|
-
<
|
|
360
|
-
<
|
|
361
|
-
<
|
|
362
|
-
<
|
|
363
|
-
<
|
|
364
|
-
<
|
|
365
|
-
<
|
|
366
|
-
<
|
|
367
|
-
<
|
|
368
|
-
<
|
|
369
|
-
<
|
|
370
|
-
<
|
|
371
|
-
<
|
|
372
|
-
<
|
|
373
|
-
<
|
|
374
|
-
<
|
|
357
|
+
<a name='L292'></a><a href='#L292'>292</a>
|
|
358
|
+
<a name='L293'></a><a href='#L293'>293</a>
|
|
359
|
+
<a name='L294'></a><a href='#L294'>294</a>
|
|
360
|
+
<a name='L295'></a><a href='#L295'>295</a>
|
|
361
|
+
<a name='L296'></a><a href='#L296'>296</a>
|
|
362
|
+
<a name='L297'></a><a href='#L297'>297</a>
|
|
363
|
+
<a name='L298'></a><a href='#L298'>298</a>
|
|
364
|
+
<a name='L299'></a><a href='#L299'>299</a>
|
|
365
|
+
<a name='L300'></a><a href='#L300'>300</a>
|
|
366
|
+
<a name='L301'></a><a href='#L301'>301</a>
|
|
367
|
+
<a name='L302'></a><a href='#L302'>302</a>
|
|
368
|
+
<a name='L303'></a><a href='#L303'>303</a>
|
|
369
|
+
<a name='L304'></a><a href='#L304'>304</a>
|
|
370
|
+
<a name='L305'></a><a href='#L305'>305</a>
|
|
371
|
+
<a name='L306'></a><a href='#L306'>306</a>
|
|
372
|
+
<a name='L307'></a><a href='#L307'>307</a>
|
|
373
|
+
<a name='L308'></a><a href='#L308'>308</a>
|
|
374
|
+
<a name='L309'></a><a href='#L309'>309</a>
|
|
375
|
+
<a name='L310'></a><a href='#L310'>310</a>
|
|
376
|
+
<a name='L311'></a><a href='#L311'>311</a>
|
|
377
|
+
<a name='L312'></a><a href='#L312'>312</a>
|
|
378
|
+
<a name='L313'></a><a href='#L313'>313</a>
|
|
379
|
+
<a name='L314'></a><a href='#L314'>314</a>
|
|
380
|
+
<a name='L315'></a><a href='#L315'>315</a>
|
|
381
|
+
<a name='L316'></a><a href='#L316'>316</a>
|
|
382
|
+
<a name='L317'></a><a href='#L317'>317</a>
|
|
383
|
+
<a name='L318'></a><a href='#L318'>318</a>
|
|
384
|
+
<a name='L319'></a><a href='#L319'>319</a>
|
|
385
|
+
<a name='L320'></a><a href='#L320'>320</a>
|
|
386
|
+
<a name='L321'></a><a href='#L321'>321</a>
|
|
387
|
+
<a name='L322'></a><a href='#L322'>322</a>
|
|
388
|
+
<a name='L323'></a><a href='#L323'>323</a>
|
|
389
|
+
<a name='L324'></a><a href='#L324'>324</a>
|
|
390
|
+
<a name='L325'></a><a href='#L325'>325</a>
|
|
391
|
+
<a name='L326'></a><a href='#L326'>326</a>
|
|
392
|
+
<a name='L327'></a><a href='#L327'>327</a>
|
|
393
|
+
<a name='L328'></a><a href='#L328'>328</a>
|
|
394
|
+
<a name='L329'></a><a href='#L329'>329</a>
|
|
395
|
+
<a name='L330'></a><a href='#L330'>330</a>
|
|
396
|
+
<a name='L331'></a><a href='#L331'>331</a>
|
|
397
|
+
<a name='L332'></a><a href='#L332'>332</a>
|
|
398
|
+
<a name='L333'></a><a href='#L333'>333</a>
|
|
399
|
+
<a name='L334'></a><a href='#L334'>334</a>
|
|
400
|
+
<a name='L335'></a><a href='#L335'>335</a>
|
|
401
|
+
<a name='L336'></a><a href='#L336'>336</a>
|
|
402
|
+
<a name='L337'></a><a href='#L337'>337</a>
|
|
403
|
+
<a name='L338'></a><a href='#L338'>338</a>
|
|
404
|
+
<a name='L339'></a><a href='#L339'>339</a>
|
|
405
|
+
<a name='L340'></a><a href='#L340'>340</a>
|
|
406
|
+
<a name='L341'></a><a href='#L341'>341</a>
|
|
407
|
+
<a name='L342'></a><a href='#L342'>342</a>
|
|
408
|
+
<a name='L343'></a><a href='#L343'>343</a>
|
|
409
|
+
<a name='L344'></a><a href='#L344'>344</a>
|
|
410
|
+
<a name='L345'></a><a href='#L345'>345</a>
|
|
411
|
+
<a name='L346'></a><a href='#L346'>346</a>
|
|
412
|
+
<a name='L347'></a><a href='#L347'>347</a>
|
|
413
|
+
<a name='L348'></a><a href='#L348'>348</a>
|
|
414
|
+
<a name='L349'></a><a href='#L349'>349</a>
|
|
415
|
+
<a name='L350'></a><a href='#L350'>350</a>
|
|
416
|
+
<a name='L351'></a><a href='#L351'>351</a>
|
|
417
|
+
<a name='L352'></a><a href='#L352'>352</a>
|
|
418
|
+
<a name='L353'></a><a href='#L353'>353</a>
|
|
419
|
+
<a name='L354'></a><a href='#L354'>354</a>
|
|
420
|
+
<a name='L355'></a><a href='#L355'>355</a>
|
|
421
|
+
<a name='L356'></a><a href='#L356'>356</a>
|
|
422
|
+
<a name='L357'></a><a href='#L357'>357</a>
|
|
423
|
+
<a name='L358'></a><a href='#L358'>358</a>
|
|
424
|
+
<a name='L359'></a><a href='#L359'>359</a>
|
|
425
|
+
<a name='L360'></a><a href='#L360'>360</a>
|
|
426
|
+
<a name='L361'></a><a href='#L361'>361</a>
|
|
427
|
+
<a name='L362'></a><a href='#L362'>362</a>
|
|
428
|
+
<a name='L363'></a><a href='#L363'>363</a>
|
|
429
|
+
<a name='L364'></a><a href='#L364'>364</a>
|
|
430
|
+
<a name='L365'></a><a href='#L365'>365</a>
|
|
431
|
+
<a name='L366'></a><a href='#L366'>366</a>
|
|
432
|
+
<a name='L367'></a><a href='#L367'>367</a>
|
|
433
|
+
<a name='L368'></a><a href='#L368'>368</a>
|
|
434
|
+
<a name='L369'></a><a href='#L369'>369</a>
|
|
435
|
+
<a name='L370'></a><a href='#L370'>370</a>
|
|
436
|
+
<a name='L371'></a><a href='#L371'>371</a>
|
|
437
|
+
<a name='L372'></a><a href='#L372'>372</a>
|
|
438
|
+
<a name='L373'></a><a href='#L373'>373</a>
|
|
439
|
+
<a name='L374'></a><a href='#L374'>374</a>
|
|
440
|
+
<a name='L375'></a><a href='#L375'>375</a>
|
|
441
|
+
<a name='L376'></a><a href='#L376'>376</a>
|
|
442
|
+
<a name='L377'></a><a href='#L377'>377</a>
|
|
443
|
+
<a name='L378'></a><a href='#L378'>378</a>
|
|
444
|
+
<a name='L379'></a><a href='#L379'>379</a>
|
|
445
|
+
<a name='L380'></a><a href='#L380'>380</a>
|
|
446
|
+
<a name='L381'></a><a href='#L381'>381</a>
|
|
447
|
+
<a name='L382'></a><a href='#L382'>382</a>
|
|
448
|
+
<a name='L383'></a><a href='#L383'>383</a>
|
|
449
|
+
<a name='L384'></a><a href='#L384'>384</a>
|
|
450
|
+
<a name='L385'></a><a href='#L385'>385</a>
|
|
451
|
+
<a name='L386'></a><a href='#L386'>386</a>
|
|
452
|
+
<a name='L387'></a><a href='#L387'>387</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
453
|
+
<span class="cline-any cline-yes">1x</span>
|
|
454
|
+
<span class="cline-any cline-yes">1x</span>
|
|
455
|
+
<span class="cline-any cline-yes">1x</span>
|
|
456
|
+
<span class="cline-any cline-yes">1x</span>
|
|
457
|
+
<span class="cline-any cline-yes">1x</span>
|
|
458
|
+
<span class="cline-any cline-yes">1x</span>
|
|
459
|
+
<span class="cline-any cline-yes">1x</span>
|
|
460
|
+
<span class="cline-any cline-yes">1x</span>
|
|
461
|
+
<span class="cline-any cline-yes">1x</span>
|
|
462
|
+
<span class="cline-any cline-yes">1x</span>
|
|
463
|
+
<span class="cline-any cline-yes">1x</span>
|
|
464
|
+
<span class="cline-any cline-yes">1x</span>
|
|
465
|
+
<span class="cline-any cline-yes">1x</span>
|
|
466
|
+
<span class="cline-any cline-yes">1x</span>
|
|
467
|
+
<span class="cline-any cline-yes">1x</span>
|
|
468
|
+
<span class="cline-any cline-yes">1x</span>
|
|
375
469
|
<span class="cline-any cline-yes">2x</span>
|
|
376
470
|
<span class="cline-any cline-yes">2x</span>
|
|
377
471
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -392,201 +486,333 @@
|
|
|
392
486
|
<span class="cline-any cline-yes">2x</span>
|
|
393
487
|
<span class="cline-any cline-yes">2x</span>
|
|
394
488
|
<span class="cline-any cline-yes">2x</span>
|
|
395
|
-
<span class="cline-any cline-yes">
|
|
489
|
+
<span class="cline-any cline-yes">1x</span>
|
|
490
|
+
<span class="cline-any cline-yes">1x</span>
|
|
396
491
|
<span class="cline-any cline-no"> </span>
|
|
397
492
|
<span class="cline-any cline-no"> </span>
|
|
398
|
-
<span class="cline-any cline-yes">4x</span>
|
|
399
|
-
<span class="cline-any cline-yes">4x</span>
|
|
400
|
-
<span class="cline-any cline-yes">4x</span>
|
|
401
|
-
<span class="cline-any cline-yes">2x</span>
|
|
402
|
-
<span class="cline-any cline-yes">2x</span>
|
|
403
493
|
<span class="cline-any cline-no"> </span>
|
|
404
494
|
<span class="cline-any cline-no"> </span>
|
|
405
495
|
<span class="cline-any cline-no"> </span>
|
|
406
496
|
<span class="cline-any cline-no"> </span>
|
|
497
|
+
<span class="cline-any cline-yes">1x</span>
|
|
498
|
+
<span class="cline-any cline-yes">1x</span>
|
|
407
499
|
<span class="cline-any cline-no"> </span>
|
|
408
500
|
<span class="cline-any cline-no"> </span>
|
|
409
|
-
<span class="cline-any cline-yes">2x</span>
|
|
410
|
-
<span class="cline-any cline-yes">2x</span>
|
|
411
|
-
<span class="cline-any cline-yes">4x</span>
|
|
412
501
|
<span class="cline-any cline-no"> </span>
|
|
413
502
|
<span class="cline-any cline-no"> </span>
|
|
414
|
-
<span class="cline-any cline-
|
|
415
|
-
<span class="cline-any cline-
|
|
416
|
-
<span class="cline-any cline-yes">
|
|
417
|
-
<span class="cline-any cline-yes">
|
|
418
|
-
<span class="cline-any cline-yes">2x</span>
|
|
503
|
+
<span class="cline-any cline-no"> </span>
|
|
504
|
+
<span class="cline-any cline-no"> </span>
|
|
505
|
+
<span class="cline-any cline-yes">1x</span>
|
|
506
|
+
<span class="cline-any cline-yes">1x</span>
|
|
419
507
|
<span class="cline-any cline-no"> </span>
|
|
420
508
|
<span class="cline-any cline-no"> </span>
|
|
421
509
|
<span class="cline-any cline-no"> </span>
|
|
422
510
|
<span class="cline-any cline-no"> </span>
|
|
423
511
|
<span class="cline-any cline-no"> </span>
|
|
424
512
|
<span class="cline-any cline-no"> </span>
|
|
425
|
-
<span class="cline-any cline-yes">2x</span>
|
|
426
|
-
<span class="cline-any cline-yes">2x</span>
|
|
427
|
-
<span class="cline-any cline-yes">4x</span>
|
|
428
|
-
<span class="cline-any cline-no"> </span>
|
|
429
|
-
<span class="cline-any cline-no"> </span>
|
|
430
|
-
<span class="cline-any cline-yes">4x</span>
|
|
431
|
-
<span class="cline-any cline-yes">4x</span>
|
|
432
|
-
<span class="cline-any cline-yes">4x</span>
|
|
433
|
-
<span class="cline-any cline-yes">4x</span>
|
|
434
|
-
<span class="cline-any cline-yes">4x</span>
|
|
435
|
-
<span class="cline-any cline-yes">4x</span>
|
|
436
|
-
<span class="cline-any cline-yes">4x</span>
|
|
437
|
-
<span class="cline-any cline-yes">3x</span>
|
|
438
|
-
<span class="cline-any cline-yes">3x</span>
|
|
439
|
-
<span class="cline-any cline-yes">3x</span>
|
|
440
|
-
<span class="cline-any cline-yes">4x</span>
|
|
441
|
-
<span class="cline-any cline-yes">4x</span>
|
|
442
|
-
<span class="cline-any cline-yes">3x</span>
|
|
443
|
-
<span class="cline-any cline-yes">3x</span>
|
|
444
|
-
<span class="cline-any cline-yes">3x</span>
|
|
445
|
-
<span class="cline-any cline-yes">3x</span>
|
|
446
|
-
<span class="cline-any cline-yes">3x</span>
|
|
447
|
-
<span class="cline-any cline-yes">3x</span>
|
|
448
|
-
<span class="cline-any cline-yes">3x</span>
|
|
449
|
-
<span class="cline-any cline-yes">3x</span>
|
|
450
|
-
<span class="cline-any cline-yes">3x</span>
|
|
451
|
-
<span class="cline-any cline-yes">3x</span>
|
|
452
|
-
<span class="cline-any cline-yes">3x</span>
|
|
453
|
-
<span class="cline-any cline-yes">3x</span>
|
|
454
|
-
<span class="cline-any cline-yes">3x</span>
|
|
455
|
-
<span class="cline-any cline-yes">3x</span>
|
|
456
|
-
<span class="cline-any cline-no"> </span>
|
|
457
|
-
<span class="cline-any cline-no"> </span>
|
|
458
|
-
<span class="cline-any cline-no"> </span>
|
|
459
|
-
<span class="cline-any cline-yes">3x</span>
|
|
460
|
-
<span class="cline-any cline-yes">3x</span>
|
|
461
|
-
<span class="cline-any cline-yes">3x</span>
|
|
462
|
-
<span class="cline-any cline-yes">3x</span>
|
|
463
|
-
<span class="cline-any cline-yes">3x</span>
|
|
464
|
-
<span class="cline-any cline-yes">3x</span>
|
|
465
|
-
<span class="cline-any cline-yes">3x</span>
|
|
466
|
-
<span class="cline-any cline-yes">3x</span>
|
|
467
|
-
<span class="cline-any cline-yes">3x</span>
|
|
468
|
-
<span class="cline-any cline-yes">3x</span>
|
|
469
|
-
<span class="cline-any cline-yes">3x</span>
|
|
470
|
-
<span class="cline-any cline-yes">3x</span>
|
|
471
|
-
<span class="cline-any cline-yes">3x</span>
|
|
472
|
-
<span class="cline-any cline-yes">3x</span>
|
|
473
|
-
<span class="cline-any cline-yes">3x</span>
|
|
474
|
-
<span class="cline-any cline-yes">1x</span>
|
|
475
|
-
<span class="cline-any cline-yes">3x</span>
|
|
476
|
-
<span class="cline-any cline-yes">2x</span>
|
|
477
|
-
<span class="cline-any cline-yes">2x</span>
|
|
478
|
-
<span class="cline-any cline-yes">3x</span>
|
|
479
|
-
<span class="cline-any cline-yes">3x</span>
|
|
480
|
-
<span class="cline-any cline-yes">1x</span>
|
|
481
|
-
<span class="cline-any cline-yes">1x</span>
|
|
482
|
-
<span class="cline-any cline-yes">1x</span>
|
|
483
|
-
<span class="cline-any cline-yes">2x</span>
|
|
484
|
-
<span class="cline-any cline-yes">2x</span>
|
|
485
|
-
<span class="cline-any cline-yes">2x</span>
|
|
486
|
-
<span class="cline-any cline-yes">2x</span>
|
|
487
|
-
<span class="cline-any cline-yes">3x</span>
|
|
488
513
|
<span class="cline-any cline-yes">1x</span>
|
|
489
514
|
<span class="cline-any cline-yes">1x</span>
|
|
490
515
|
<span class="cline-any cline-no"> </span>
|
|
491
516
|
<span class="cline-any cline-no"> </span>
|
|
492
|
-
<span class="cline-any cline-
|
|
493
|
-
<span class="cline-any cline-
|
|
517
|
+
<span class="cline-any cline-no"> </span>
|
|
518
|
+
<span class="cline-any cline-no"> </span>
|
|
519
|
+
<span class="cline-any cline-no"> </span>
|
|
520
|
+
<span class="cline-any cline-no"> </span>
|
|
494
521
|
<span class="cline-any cline-yes">1x</span>
|
|
495
522
|
<span class="cline-any cline-yes">1x</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
|
+
<span class="cline-any cline-no"> </span>
|
|
528
|
+
<span class="cline-any cline-no"> </span>
|
|
529
|
+
<span class="cline-any cline-no"> </span>
|
|
530
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
535
|
+
<span class="cline-any cline-no"> </span>
|
|
536
|
+
<span class="cline-any cline-no"> </span>
|
|
537
|
+
<span class="cline-any cline-no"> </span>
|
|
538
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
543
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
549
|
+
<span class="cline-any cline-no"> </span>
|
|
550
|
+
<span class="cline-any cline-no"> </span>
|
|
551
|
+
<span class="cline-any cline-no"> </span>
|
|
552
|
+
<span class="cline-any cline-no"> </span>
|
|
553
|
+
<span class="cline-any cline-no"> </span>
|
|
554
|
+
<span class="cline-any cline-no"> </span>
|
|
555
|
+
<span class="cline-any cline-no"> </span>
|
|
556
|
+
<span class="cline-any cline-no"> </span>
|
|
557
|
+
<span class="cline-any cline-no"> </span>
|
|
558
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
566
|
+
<span class="cline-any cline-no"> </span>
|
|
567
|
+
<span class="cline-any cline-no"> </span>
|
|
568
|
+
<span class="cline-any cline-no"> </span>
|
|
569
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
574
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
579
|
+
<span class="cline-any cline-no"> </span>
|
|
580
|
+
<span class="cline-any cline-no"> </span>
|
|
581
|
+
<span class="cline-any cline-no"> </span>
|
|
582
|
+
<span class="cline-any cline-no"> </span>
|
|
583
|
+
<span class="cline-any cline-no"> </span>
|
|
584
|
+
<span class="cline-any cline-no"> </span>
|
|
585
|
+
<span class="cline-any cline-no"> </span>
|
|
586
|
+
<span class="cline-any cline-no"> </span>
|
|
587
|
+
<span class="cline-any cline-no"> </span>
|
|
588
|
+
<span class="cline-any cline-no"> </span>
|
|
589
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
595
|
+
<span class="cline-any cline-no"> </span>
|
|
596
|
+
<span class="cline-any cline-no"> </span>
|
|
597
|
+
<span class="cline-any cline-no"> </span>
|
|
496
598
|
<span class="cline-any cline-yes">1x</span>
|
|
497
599
|
<span class="cline-any cline-yes">1x</span>
|
|
498
|
-
<span class="cline-any cline-yes">3x</span>
|
|
499
|
-
<span class="cline-any cline-yes">2x</span>
|
|
500
|
-
<span class="cline-any cline-yes">2x</span>
|
|
501
|
-
<span class="cline-any cline-yes">4x</span>
|
|
502
|
-
<span class="cline-any cline-yes">2x</span>
|
|
503
|
-
<span class="cline-any cline-yes">2x</span>
|
|
504
|
-
<span class="cline-any cline-yes">243x</span>
|
|
505
600
|
<span class="cline-any cline-no"> </span>
|
|
506
601
|
<span class="cline-any cline-no"> </span>
|
|
507
|
-
<span class="cline-any cline-yes">243x</span>
|
|
508
|
-
<span class="cline-any cline-yes">243x</span>
|
|
509
|
-
<span class="cline-any cline-yes">243x</span>
|
|
510
|
-
<span class="cline-any cline-yes">243x</span>
|
|
511
|
-
<span class="cline-any cline-yes">243x</span>
|
|
512
|
-
<span class="cline-any cline-yes">243x</span>
|
|
513
|
-
<span class="cline-any cline-yes">243x</span>
|
|
514
|
-
<span class="cline-any cline-yes">243x</span>
|
|
515
|
-
<span class="cline-any cline-yes">243x</span>
|
|
516
|
-
<span class="cline-any cline-yes">243x</span>
|
|
517
|
-
<span class="cline-any cline-yes">243x</span>
|
|
518
|
-
<span class="cline-any cline-yes">243x</span>
|
|
519
|
-
<span class="cline-any cline-yes">10x</span>
|
|
520
|
-
<span class="cline-any cline-yes">10x</span>
|
|
521
|
-
<span class="cline-any cline-yes">10x</span>
|
|
522
|
-
<span class="cline-any cline-yes">243x</span>
|
|
523
|
-
<span class="cline-any cline-yes">243x</span>
|
|
524
|
-
<span class="cline-any cline-yes">5x</span>
|
|
525
|
-
<span class="cline-any cline-yes">5x</span>
|
|
526
|
-
<span class="cline-any cline-yes">5x</span>
|
|
527
|
-
<span class="cline-any cline-yes">243x</span>
|
|
528
|
-
<span class="cline-any cline-yes">243x</span>
|
|
529
602
|
<span class="cline-any cline-no"> </span>
|
|
530
603
|
<span class="cline-any cline-no"> </span>
|
|
531
604
|
<span class="cline-any cline-no"> </span>
|
|
532
|
-
<span class="cline-any cline-
|
|
533
|
-
<span class="cline-any cline-
|
|
534
|
-
<span class="cline-any cline-
|
|
535
|
-
<span class="cline-any cline-
|
|
536
|
-
<span class="cline-any cline-
|
|
537
|
-
<span class="cline-any cline-
|
|
538
|
-
<span class="cline-any cline-
|
|
539
|
-
<span class="cline-any cline-
|
|
540
|
-
<span class="cline-any cline-
|
|
541
|
-
<span class="cline-any cline-
|
|
542
|
-
<span class="cline-any cline-
|
|
543
|
-
<span class="cline-any cline-
|
|
544
|
-
<span class="cline-any cline-
|
|
545
|
-
<span class="cline-any cline-
|
|
546
|
-
<span class="cline-any cline-
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
611
|
+
<span class="cline-any cline-no"> </span>
|
|
612
|
+
<span class="cline-any cline-no"> </span>
|
|
613
|
+
<span class="cline-any cline-no"> </span>
|
|
614
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
621
|
+
<span class="cline-any cline-no"> </span>
|
|
622
|
+
<span class="cline-any cline-no"> </span>
|
|
623
|
+
<span class="cline-any cline-no"> </span>
|
|
624
|
+
<span class="cline-any cline-no"> </span>
|
|
625
|
+
<span class="cline-any cline-no"> </span>
|
|
626
|
+
<span class="cline-any cline-no"> </span>
|
|
627
|
+
<span class="cline-any cline-no"> </span>
|
|
628
|
+
<span class="cline-any cline-no"> </span>
|
|
629
|
+
<span class="cline-any cline-no"> </span>
|
|
630
|
+
<span class="cline-any cline-no"> </span>
|
|
631
|
+
<span class="cline-any cline-no"> </span>
|
|
632
|
+
<span class="cline-any cline-no"> </span>
|
|
633
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
638
|
+
<span class="cline-any cline-no"> </span>
|
|
639
|
+
<span class="cline-any cline-no"> </span>
|
|
640
|
+
<span class="cline-any cline-no"> </span>
|
|
641
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
646
|
+
<span class="cline-any cline-no"> </span>
|
|
647
|
+
<span class="cline-any cline-no"> </span>
|
|
648
|
+
<span class="cline-any cline-no"> </span>
|
|
649
|
+
<span class="cline-any cline-no"> </span>
|
|
650
|
+
<span class="cline-any cline-no"> </span>
|
|
651
|
+
<span class="cline-any cline-no"> </span>
|
|
652
|
+
<span class="cline-any cline-no"> </span>
|
|
653
|
+
<span class="cline-any cline-no"> </span>
|
|
654
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
661
|
+
<span class="cline-any cline-no"> </span>
|
|
662
|
+
<span class="cline-any cline-no"> </span>
|
|
663
|
+
<span class="cline-any cline-no"> </span>
|
|
664
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
669
|
+
<span class="cline-any cline-no"> </span>
|
|
670
|
+
<span class="cline-any cline-no"> </span>
|
|
671
|
+
<span class="cline-any cline-no"> </span>
|
|
672
|
+
<span class="cline-any cline-no"> </span>
|
|
673
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
685
|
+
<span class="cline-any cline-no"> </span>
|
|
686
|
+
<span class="cline-any cline-no"> </span>
|
|
687
|
+
<span class="cline-any cline-no"> </span>
|
|
688
|
+
<span class="cline-any cline-no"> </span>
|
|
689
|
+
<span class="cline-any cline-no"> </span>
|
|
690
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
696
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
702
|
+
<span class="cline-any cline-no"> </span>
|
|
703
|
+
<span class="cline-any cline-no"> </span>
|
|
704
|
+
<span class="cline-any cline-no"> </span>
|
|
705
|
+
<span class="cline-any cline-no"> </span>
|
|
706
|
+
<span class="cline-any cline-no"> </span>
|
|
707
|
+
<span class="cline-any cline-no"> </span>
|
|
708
|
+
<span class="cline-any cline-no"> </span>
|
|
709
|
+
<span class="cline-any cline-no"> </span>
|
|
710
|
+
<span class="cline-any cline-no"> </span>
|
|
711
|
+
<span class="cline-any cline-no"> </span>
|
|
712
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
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
|
+
<span class="cline-any cline-no"> </span>
|
|
722
|
+
<span class="cline-any cline-no"> </span>
|
|
547
723
|
<span class="cline-any cline-yes">1x</span>
|
|
548
724
|
<span class="cline-any cline-yes">1x</span>
|
|
549
725
|
<span class="cline-any cline-yes">1x</span>
|
|
550
726
|
<span class="cline-any cline-no"> </span>
|
|
727
|
+
<span class="cline-any cline-no"> </span>
|
|
728
|
+
<span class="cline-any cline-no"> </span>
|
|
729
|
+
<span class="cline-any cline-no"> </span>
|
|
730
|
+
<span class="cline-any cline-no"> </span>
|
|
731
|
+
<span class="cline-any cline-no"> </span>
|
|
732
|
+
<span class="cline-any cline-no"> </span>
|
|
733
|
+
<span class="cline-any cline-no"> </span>
|
|
734
|
+
<span class="cline-any cline-no"> </span>
|
|
735
|
+
<span class="cline-any cline-no"> </span>
|
|
736
|
+
<span class="cline-any cline-no"> </span>
|
|
737
|
+
<span class="cline-any cline-no"> </span>
|
|
738
|
+
<span class="cline-any cline-no"> </span>
|
|
739
|
+
<span class="cline-any cline-no"> </span>
|
|
740
|
+
<span class="cline-any cline-no"> </span>
|
|
551
741
|
<span class="cline-any cline-yes">1x</span>
|
|
552
742
|
<span class="cline-any cline-yes">1x</span>
|
|
553
743
|
<span class="cline-any cline-yes">1x</span>
|
|
744
|
+
<span class="cline-any cline-no"> </span>
|
|
745
|
+
<span class="cline-any cline-no"> </span>
|
|
746
|
+
<span class="cline-any cline-no"> </span>
|
|
747
|
+
<span class="cline-any cline-no"> </span>
|
|
748
|
+
<span class="cline-any cline-no"> </span>
|
|
749
|
+
<span class="cline-any cline-no"> </span>
|
|
750
|
+
<span class="cline-any cline-no"> </span>
|
|
751
|
+
<span class="cline-any cline-no"> </span>
|
|
752
|
+
<span class="cline-any cline-no"> </span>
|
|
753
|
+
<span class="cline-any cline-no"> </span>
|
|
754
|
+
<span class="cline-any cline-no"> </span>
|
|
755
|
+
<span class="cline-any cline-no"> </span>
|
|
756
|
+
<span class="cline-any cline-no"> </span>
|
|
757
|
+
<span class="cline-any cline-no"> </span>
|
|
758
|
+
<span class="cline-any cline-no"> </span>
|
|
759
|
+
<span class="cline-any cline-no"> </span>
|
|
760
|
+
<span class="cline-any cline-no"> </span>
|
|
761
|
+
<span class="cline-any cline-no"> </span>
|
|
762
|
+
<span class="cline-any cline-no"> </span>
|
|
763
|
+
<span class="cline-any cline-no"> </span>
|
|
764
|
+
<span class="cline-any cline-no"> </span>
|
|
765
|
+
<span class="cline-any cline-no"> </span>
|
|
766
|
+
<span class="cline-any cline-no"> </span>
|
|
767
|
+
<span class="cline-any cline-no"> </span>
|
|
768
|
+
<span class="cline-any cline-no"> </span>
|
|
769
|
+
<span class="cline-any cline-no"> </span>
|
|
770
|
+
<span class="cline-any cline-no"> </span>
|
|
771
|
+
<span class="cline-any cline-no"> </span>
|
|
772
|
+
<span class="cline-any cline-no"> </span>
|
|
773
|
+
<span class="cline-any cline-no"> </span>
|
|
774
|
+
<span class="cline-any cline-no"> </span>
|
|
775
|
+
<span class="cline-any cline-no"> </span>
|
|
776
|
+
<span class="cline-any cline-no"> </span>
|
|
777
|
+
<span class="cline-any cline-no"> </span>
|
|
778
|
+
<span class="cline-any cline-no"> </span>
|
|
779
|
+
<span class="cline-any cline-no"> </span>
|
|
780
|
+
<span class="cline-any cline-no"> </span>
|
|
781
|
+
<span class="cline-any cline-no"> </span>
|
|
782
|
+
<span class="cline-any cline-no"> </span>
|
|
554
783
|
<span class="cline-any cline-yes">1x</span>
|
|
555
|
-
<span class="cline-any cline-yes">10x</span>
|
|
556
|
-
<span class="cline-any cline-yes">10x</span>
|
|
557
|
-
<span class="cline-any cline-yes">10x</span>
|
|
558
|
-
<span class="cline-any cline-yes">4x</span>
|
|
559
|
-
<span class="cline-any cline-yes">10x</span>
|
|
560
|
-
<span class="cline-any cline-yes">10x</span>
|
|
561
|
-
<span class="cline-any cline-yes">10x</span>
|
|
562
784
|
<span class="cline-any cline-yes">1x</span>
|
|
785
|
+
<span class="cline-any cline-no"> </span>
|
|
786
|
+
<span class="cline-any cline-no"> </span>
|
|
787
|
+
<span class="cline-any cline-no"> </span>
|
|
788
|
+
<span class="cline-any cline-no"> </span>
|
|
789
|
+
<span class="cline-any cline-no"> </span>
|
|
790
|
+
<span class="cline-any cline-no"> </span>
|
|
791
|
+
<span class="cline-any cline-no"> </span>
|
|
792
|
+
<span class="cline-any cline-no"> </span>
|
|
793
|
+
<span class="cline-any cline-no"> </span>
|
|
794
|
+
<span class="cline-any cline-no"> </span>
|
|
795
|
+
<span class="cline-any cline-no"> </span>
|
|
796
|
+
<span class="cline-any cline-no"> </span>
|
|
797
|
+
<span class="cline-any cline-no"> </span>
|
|
798
|
+
<span class="cline-any cline-no"> </span>
|
|
799
|
+
<span class="cline-any cline-no"> </span>
|
|
800
|
+
<span class="cline-any cline-no"> </span>
|
|
801
|
+
<span class="cline-any cline-no"> </span>
|
|
802
|
+
<span class="cline-any cline-no"> </span>
|
|
803
|
+
<span class="cline-any cline-no"> </span>
|
|
804
|
+
<span class="cline-any cline-no"> </span>
|
|
805
|
+
<span class="cline-any cline-no"> </span>
|
|
806
|
+
<span class="cline-any cline-no"> </span>
|
|
807
|
+
<span class="cline-any cline-no"> </span>
|
|
808
|
+
<span class="cline-any cline-no"> </span>
|
|
809
|
+
<span class="cline-any cline-no"> </span>
|
|
810
|
+
<span class="cline-any cline-no"> </span>
|
|
563
811
|
<span class="cline-any cline-yes">1x</span>
|
|
564
812
|
<span class="cline-any cline-yes">1x</span>
|
|
565
|
-
<span class="cline-any cline-yes">9x</span>
|
|
566
|
-
<span class="cline-any cline-yes">10x</span>
|
|
567
|
-
<span class="cline-any cline-yes">5x</span>
|
|
568
|
-
<span class="cline-any cline-yes">5x</span>
|
|
569
|
-
<span class="cline-any cline-yes">5x</span>
|
|
570
|
-
<span class="cline-any cline-yes">5x</span>
|
|
571
|
-
<span class="cline-any cline-yes">5x</span>
|
|
572
|
-
<span class="cline-any cline-yes">3x</span>
|
|
573
|
-
<span class="cline-any cline-yes">3x</span>
|
|
574
|
-
<span class="cline-any cline-yes">3x</span>
|
|
575
813
|
<span class="cline-any cline-no"> </span>
|
|
576
814
|
<span class="cline-any cline-no"> </span>
|
|
577
815
|
<span class="cline-any cline-no"> </span>
|
|
578
|
-
<span class="cline-any cline-yes">5x</span>
|
|
579
|
-
<span class="cline-any cline-yes">2x</span>
|
|
580
|
-
<span class="cline-any cline-yes">2x</span>
|
|
581
|
-
<span class="cline-any cline-yes">2x</span>
|
|
582
|
-
<span class="cline-any cline-yes">2x</span>
|
|
583
|
-
<span class="cline-any cline-yes">2x</span>
|
|
584
|
-
<span class="cline-any cline-yes">2x</span>
|
|
585
|
-
<span class="cline-any cline-yes">2x</span>
|
|
586
|
-
<span class="cline-any cline-yes">2x</span>
|
|
587
|
-
<span class="cline-any cline-yes">2x</span>
|
|
588
|
-
<span class="cline-any cline-yes">2x</span>
|
|
589
|
-
<span class="cline-any cline-yes">2x</span>
|
|
590
816
|
<span class="cline-any cline-no"> </span>
|
|
591
817
|
<span class="cline-any cline-no"> </span>
|
|
592
818
|
<span class="cline-any cline-no"> </span>
|
|
@@ -594,57 +820,21 @@
|
|
|
594
820
|
<span class="cline-any cline-no"> </span>
|
|
595
821
|
<span class="cline-any cline-no"> </span>
|
|
596
822
|
<span class="cline-any cline-no"> </span>
|
|
597
|
-
<span class="cline-any cline-
|
|
598
|
-
<span class="cline-any cline-
|
|
599
|
-
<span class="cline-any cline-
|
|
600
|
-
<span class="cline-any cline-
|
|
601
|
-
<span class="cline-any cline-
|
|
602
|
-
<span class="cline-any cline-
|
|
603
|
-
<span class="cline-any cline-
|
|
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-
|
|
610
|
-
<span class="cline-any cline-
|
|
611
|
-
<span class="cline-any cline-no"> </span>
|
|
612
|
-
<span class="cline-any cline-no"> </span>
|
|
613
|
-
<span class="cline-any cline-no"> </span>
|
|
614
|
-
<span class="cline-any cline-yes">4x</span>
|
|
615
|
-
<span class="cline-any cline-yes">4x</span>
|
|
616
|
-
<span class="cline-any cline-yes">1x</span>
|
|
617
|
-
<span class="cline-any cline-yes">1x</span>
|
|
618
|
-
<span class="cline-any cline-yes">4x</span>
|
|
619
|
-
<span class="cline-any cline-yes">4x</span>
|
|
620
|
-
<span class="cline-any cline-yes">4x</span>
|
|
621
|
-
<span class="cline-any cline-yes">4x</span>
|
|
622
|
-
<span class="cline-any cline-yes">243x</span>
|
|
623
|
-
<span class="cline-any cline-yes">233x</span>
|
|
624
|
-
<span class="cline-any cline-yes">233x</span>
|
|
625
|
-
<span class="cline-any cline-yes">238x</span>
|
|
626
|
-
<span class="cline-any cline-yes">238x</span>
|
|
627
|
-
<span class="cline-any cline-yes">238x</span>
|
|
628
|
-
<span class="cline-any cline-yes">243x</span>
|
|
629
|
-
<span class="cline-any cline-yes">2x</span>
|
|
630
|
-
<span class="cline-any cline-yes">2x</span>
|
|
631
|
-
<span class="cline-any cline-yes">6x</span>
|
|
632
|
-
<span class="cline-any cline-yes">19x</span>
|
|
633
|
-
<span class="cline-any cline-yes">19x</span>
|
|
634
|
-
<span class="cline-any cline-yes">19x</span>
|
|
635
|
-
<span class="cline-any cline-yes">19x</span>
|
|
636
|
-
<span class="cline-any cline-yes">19x</span>
|
|
637
|
-
<span class="cline-any cline-yes">19x</span>
|
|
638
|
-
<span class="cline-any cline-yes">19x</span>
|
|
639
|
-
<span class="cline-any cline-yes">19x</span>
|
|
640
|
-
<span class="cline-any cline-yes">19x</span>
|
|
641
|
-
<span class="cline-any cline-yes">12x</span>
|
|
642
|
-
<span class="cline-any cline-yes">12x</span>
|
|
643
|
-
<span class="cline-any cline-yes">19x</span>
|
|
644
|
-
<span class="cline-any cline-yes">19x</span>
|
|
645
|
-
<span class="cline-any cline-yes">19x</span>
|
|
646
|
-
<span class="cline-any cline-yes">6x</span>
|
|
647
|
-
<span class="cline-any cline-neutral"> </span>
|
|
823
|
+
<span class="cline-any cline-no"> </span>
|
|
824
|
+
<span class="cline-any cline-no"> </span>
|
|
825
|
+
<span class="cline-any cline-no"> </span>
|
|
826
|
+
<span class="cline-any cline-no"> </span>
|
|
827
|
+
<span class="cline-any cline-no"> </span>
|
|
828
|
+
<span class="cline-any cline-no"> </span>
|
|
829
|
+
<span class="cline-any cline-no"> </span>
|
|
830
|
+
<span class="cline-any cline-no"> </span>
|
|
831
|
+
<span class="cline-any cline-no"> </span>
|
|
832
|
+
<span class="cline-any cline-no"> </span>
|
|
833
|
+
<span class="cline-any cline-no"> </span>
|
|
834
|
+
<span class="cline-any cline-no"> </span>
|
|
835
|
+
<span class="cline-any cline-no"> </span>
|
|
836
|
+
<span class="cline-any cline-no"> </span>
|
|
837
|
+
<span class="cline-any cline-no"> </span>
|
|
648
838
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import _ from 'lodash'
|
|
649
839
|
import makeDebug from 'debug'
|
|
650
840
|
import common from 'feathers-hooks-common'
|
|
@@ -655,6 +845,7 @@ import {
|
|
|
655
845
|
hasServiceAbilities, hasResourceAbilities, getQueryForAbilities,
|
|
656
846
|
Roles, RoleNames, countSubjectsForResource
|
|
657
847
|
} from '../../common/permissions.js'
|
|
848
|
+
import { isTagEqual } from '../utils.js'
|
|
658
849
|
|
|
659
850
|
const { getItems, replaceItems } = common
|
|
660
851
|
const { Forbidden } = errors
|
|
@@ -671,7 +862,7 @@ export function createJWT (options = {}) {
|
|
|
671
862
|
const accessTokens = await Promise.all(items.map(item => hook.app.getService('authentication').createAccessToken(
|
|
672
863
|
// Provided function can be used to pick or omit properties in JWT payload
|
|
673
864
|
(typeof options.payload === 'function' ? options.payload(user) : {}),
|
|
674
|
-
// Provided function can be used for custom options
|
|
865
|
+
// Provided function can be used for custom options cdepending on the user,
|
|
675
866
|
// then we merge with default auth options for global properties like aud, iss, etc.
|
|
676
867
|
_.merge({}, defaults, (typeof options.jwt === 'function' ? options.jwt(user) : options)))
|
|
677
868
|
))
|
|
@@ -682,13 +873,13 @@ export function createJWT (options = {}) {
|
|
|
682
873
|
}
|
|
683
874
|
}
|
|
684
875
|
|
|
685
|
-
export function populateSubjects (hook) {
|
|
686
|
-
|
|
876
|
+
export <span class="fstat-no" title="function not covered" >function populateSubjects (hook) {</span>
|
|
877
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
687
878
|
<span class="cstat-no" title="statement not covered" > throw new Error('The \'populateSubjects\' hook should only be used as a \'before\' hook.')</span>
|
|
688
879
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
689
|
-
|
|
690
|
-
return populateObjects({ serviceField: 'subjectsService', idField: 'subjects', throwOnNotFound: true })(hook)
|
|
691
|
-
}
|
|
880
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
881
|
+
<span class="cstat-no" title="statement not covered" > return populateObjects({ serviceField: 'subjectsService', idField: 'subjects', throwOnNotFound: true })(hook)</span>
|
|
882
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
692
883
|
|
|
693
884
|
export <span class="fstat-no" title="function not covered" >function unpopulateSubjects (hook) {</span>
|
|
694
885
|
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
@@ -698,13 +889,13 @@ export <span class="fstat-no" title="function not covered" >function unpopulateS
|
|
|
698
889
|
<span class="cstat-no" title="statement not covered" > return unpopulateObjects({ serviceField: 'subjectsService', idField: 'subjects' })(hook)</span>
|
|
699
890
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
700
891
|
|
|
701
|
-
export function populateResource (hook) {
|
|
702
|
-
|
|
892
|
+
export <span class="fstat-no" title="function not covered" >function populateResource (hook) {</span>
|
|
893
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
703
894
|
<span class="cstat-no" title="statement not covered" > throw new Error('The \'populateResource\' hook should only be used as a \'before\' hook.')</span>
|
|
704
895
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
705
|
-
|
|
706
|
-
return populateObject({ serviceField: 'resourcesService', idField: 'resource', throwOnNotFound: true })(hook)
|
|
707
|
-
}
|
|
896
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
897
|
+
<span class="cstat-no" title="statement not covered" > return populateObject({ serviceField: 'resourcesService', idField: 'resource', throwOnNotFound: true })(hook)</span>
|
|
898
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
708
899
|
|
|
709
900
|
export <span class="fstat-no" title="function not covered" >function unpopulateResource (hook) {</span>
|
|
710
901
|
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
@@ -714,170 +905,168 @@ export <span class="fstat-no" title="function not covered" >function unpopulateR
|
|
|
714
905
|
<span class="cstat-no" title="statement not covered" > return unpopulateObject({ serviceField: 'resourcesService', idField: 'resource' })(hook)</span>
|
|
715
906
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
716
907
|
|
|
717
|
-
export function preventEscalation (hook) {
|
|
718
|
-
|
|
908
|
+
export <span class="fstat-no" title="function not covered" >function preventEscalation (hook) {</span>
|
|
909
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
719
910
|
<span class="cstat-no" title="statement not covered" > throw new Error('The \'preventEscalation\' hook should only be used as a \'before\' hook.')</span>
|
|
720
911
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
721
|
-
|
|
722
|
-
const params = hook.params
|
|
723
|
-
// If called internally we skip authorisation
|
|
724
|
-
let checkEscalation = _.has(params, 'provider')
|
|
725
|
-
|
|
726
|
-
// If explicitely asked to perform/skip, override defaults
|
|
727
|
-
if (_.has(params, 'checkEscalation')) {
|
|
728
|
-
checkEscalation = params.checkEscalation
|
|
729
|
-
debug('Escalation check ' + (checkEscalation ? 'forced'
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
if (checkEscalation) {
|
|
733
|
-
const user = params.user
|
|
734
|
-
// Make hook usable on remove as well
|
|
735
|
-
const data = hook.data || {}
|
|
736
|
-
// Make hook usable with query params as well
|
|
737
|
-
const query = params.query || {}
|
|
738
|
-
const scopeName = data.scope || query.scope // Get scope name first
|
|
739
|
-
// Retrieve the right scope on the user
|
|
740
|
-
const scope = _.get(user, scopeName, [])
|
|
741
|
-
// Then the target resource
|
|
742
|
-
const resource = _.find(scope, resource => resource._id && (resource._id.toString() === params.resource._id.toString()))
|
|
743
|
-
// Then user permission level
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
912
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
913
|
+
<span class="cstat-no" title="statement not covered" > const params = hook.params</span>
|
|
914
|
+
<span class="cstat-no" title="statement not covered" > // If called internally we skip authorisation</span>
|
|
915
|
+
<span class="cstat-no" title="statement not covered" > let checkEscalation = _.has(params, 'provider')</span>
|
|
916
|
+
<span class="cstat-no" title="statement not covered" > debug('Escalation check ' + (checkEscalation ? 'enabled' : 'disabled') + ' for provider')</span>
|
|
917
|
+
<span class="cstat-no" title="statement not covered" > // If explicitely asked to perform/skip, override defaults</span>
|
|
918
|
+
<span class="cstat-no" title="statement not covered" > if (_.has(params, 'checkEscalation')) {</span>
|
|
919
|
+
<span class="cstat-no" title="statement not covered" > checkEscalation = params.checkEscalation</span>
|
|
920
|
+
<span class="cstat-no" title="statement not covered" > debug('Escalation check ' + (checkEscalation ? 'forced' : 'unforced'))</span>
|
|
921
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
922
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
923
|
+
<span class="cstat-no" title="statement not covered" > if (checkEscalation) {</span>
|
|
924
|
+
<span class="cstat-no" title="statement not covered" > const user = params.user</span>
|
|
925
|
+
<span class="cstat-no" title="statement not covered" > // Make hook usable on remove as well</span>
|
|
926
|
+
<span class="cstat-no" title="statement not covered" > const data = hook.data || {}</span>
|
|
927
|
+
<span class="cstat-no" title="statement not covered" > // Make hook usable with query params as well</span>
|
|
928
|
+
<span class="cstat-no" title="statement not covered" > const query = params.query || {}</span>
|
|
929
|
+
<span class="cstat-no" title="statement not covered" > const scopeName = data.scope || query.scope // Get scope name first</span>
|
|
930
|
+
<span class="cstat-no" title="statement not covered" > // Retrieve the right scope on the user</span>
|
|
931
|
+
<span class="cstat-no" title="statement not covered" > const scope = _.get(user, scopeName, [])</span>
|
|
932
|
+
<span class="cstat-no" title="statement not covered" > // Then the target resource</span>
|
|
933
|
+
<span class="cstat-no" title="statement not covered" > const resource = _.find(scope, resource => resource._id && (resource._id.toString() === params.resource._id.toString()))</span>
|
|
934
|
+
<span class="cstat-no" title="statement not covered" > // Then user permission level</span>
|
|
935
|
+
<span class="cstat-no" title="statement not covered" > const permissions = (resource ? resource.permissions : undefined)</span>
|
|
936
|
+
<span class="cstat-no" title="statement not covered" > const role = (permissions ? Roles[permissions] : undefined)</span>
|
|
937
|
+
<span class="cstat-no" title="statement not covered" > if (_.isUndefined(role)) {</span>
|
|
747
938
|
<span class="cstat-no" title="statement not covered" > debug('Role for authorisation not found on user for scope ' + scopeName)</span>
|
|
748
939
|
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to change authorisation on resource')</span>
|
|
749
940
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
750
|
-
|
|
751
|
-
// Check if privilege escalation might occur, if so clamp to user permission level
|
|
752
|
-
|
|
753
|
-
// Input subjects need to be checked
|
|
754
|
-
// - on create you should not be able to change permissions on others having higher permissions than yourself
|
|
755
|
-
// (e.g. cannot change a owner into a manager when you are a manager)
|
|
756
|
-
// - on remove you should not be able to remove permissions on others having higher permissions than yourself
|
|
757
|
-
// (e.g. cannot remove a owner when you are a manager)
|
|
758
|
-
const subjects = params.subjects.filter(subject => {
|
|
759
|
-
const subjectScope = _.get(subject, scopeName, [])
|
|
760
|
-
const subjectResource = _.find(subjectScope, resource => resource._id && (resource._id.toString() === params.resource._id.toString()))
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
const hasRole = !_.isUndefined(subjectRole)
|
|
764
|
-
if (hook.method === 'create') {
|
|
765
|
-
return (!hasRole || (subjectRole <= role)) // The first time no authorisation can be found
|
|
766
|
-
} else {
|
|
767
|
-
return (hasRole && (subjectRole <= role)) // Authorisation must be found on remove
|
|
768
|
-
}
|
|
769
|
-
})
|
|
770
|
-
if (subjects.length < params.subjects.length) {
|
|
771
|
-
debug(`${(params.subjects.length - subjects.length)} subjects with higher permissions level found for scope ${scopeName}`)
|
|
772
|
-
throw new Forbidden('You are not allowed to change authorisation on subject(s)')
|
|
773
|
-
}
|
|
774
|
-
// Input permissions needs to be checked since
|
|
775
|
-
// - you should not be able to give higher permissions than your own ones to others
|
|
776
|
-
// (e.g. cannot create a owner when you are a manager)
|
|
777
|
-
let authorisationRole
|
|
778
|
-
if (data.permissions) {
|
|
779
|
-
authorisationRole = Roles[data.permissions]
|
|
780
|
-
|
|
941
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
942
|
+
<span class="cstat-no" title="statement not covered" > // Check if privilege escalation might occur, if so clamp to user permission level</span>
|
|
943
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
944
|
+
<span class="cstat-no" title="statement not covered" > // Input subjects need to be checked:</span>
|
|
945
|
+
<span class="cstat-no" title="statement not covered" > // - on create you should not be able to change permissions on others having higher permissions than yourself</span>
|
|
946
|
+
<span class="cstat-no" title="statement not covered" > // (e.g. cannot change a owner into a manager when you are a manager)</span>
|
|
947
|
+
<span class="cstat-no" title="statement not covered" > // - on remove you should not be able to remove permissions on others having higher permissions than yourself</span>
|
|
948
|
+
<span class="cstat-no" title="statement not covered" > // (e.g. cannot remove a owner when you are a manager)</span>
|
|
949
|
+
<span class="cstat-no" title="statement not covered" > const subjects = params.subjects.filter(subject => {</span>
|
|
950
|
+
<span class="cstat-no" title="statement not covered" > const subjectScope = _.get(subject, scopeName, [])</span>
|
|
951
|
+
<span class="cstat-no" title="statement not covered" > const subjectResource = _.find(subjectScope, resource => resource._id && (resource._id.toString() === params.resource._id.toString()))</span>
|
|
952
|
+
<span class="cstat-no" title="statement not covered" > const subjectPermissions = (subjectResource ? subjectResource.permissions : undefined)</span>
|
|
953
|
+
<span class="cstat-no" title="statement not covered" > const subjectRole = (subjectPermissions ? Roles[subjectPermissions] : undefined)</span>
|
|
954
|
+
<span class="cstat-no" title="statement not covered" > const hasRole = !_.isUndefined(subjectRole)</span>
|
|
955
|
+
<span class="cstat-no" title="statement not covered" > if (hook.method === 'create') {</span>
|
|
956
|
+
<span class="cstat-no" title="statement not covered" > return (!hasRole || (subjectRole <= role)) // The first time no authorisation can be found</span>
|
|
957
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
958
|
+
<span class="cstat-no" title="statement not covered" > return (hasRole && (subjectRole <= role)) // Authorisation must be found on remove</span>
|
|
959
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
960
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
961
|
+
<span class="cstat-no" title="statement not covered" > if (subjects.length < params.subjects.length) {</span>
|
|
962
|
+
<span class="cstat-no" title="statement not covered" > debug(`${(params.subjects.length - subjects.length)} subjects with higher permissions level found for scope ${scopeName}`)</span>
|
|
963
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to change authorisation on subject(s)')</span>
|
|
964
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
965
|
+
<span class="cstat-no" title="statement not covered" > // Input permissions needs to be checked since:</span>
|
|
966
|
+
<span class="cstat-no" title="statement not covered" > // - you should not be able to give higher permissions than your own ones to others</span>
|
|
967
|
+
<span class="cstat-no" title="statement not covered" > // (e.g. cannot create a owner when you are a manager)</span>
|
|
968
|
+
<span class="cstat-no" title="statement not covered" > let authorisationRole</span>
|
|
969
|
+
<span class="cstat-no" title="statement not covered" > if (data.permissions) {</span>
|
|
970
|
+
<span class="cstat-no" title="statement not covered" > authorisationRole = Roles[data.permissions]</span>
|
|
971
|
+
<span class="cstat-no" title="statement not covered" > } else if (query.permissions) {</span>
|
|
781
972
|
<span class="cstat-no" title="statement not covered" > authorisationRole = Roles[query.permissions]</span>
|
|
782
973
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
783
|
-
if (!_.isUndefined(authorisationRole)) {
|
|
784
|
-
if (authorisationRole > role) {
|
|
785
|
-
debug('Cannot escalate with higher permissions level for scope ' + scopeName)
|
|
786
|
-
throw new Forbidden('You are not allowed to change authorisation on resource')
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
return hook
|
|
792
|
-
}
|
|
974
|
+
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(authorisationRole)) {</span>
|
|
975
|
+
<span class="cstat-no" title="statement not covered" > if (authorisationRole > role) {</span>
|
|
976
|
+
<span class="cstat-no" title="statement not covered" > debug('Cannot escalate with higher permissions level for scope ' + scopeName)</span>
|
|
977
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to change authorisation on resource')</span>
|
|
978
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
979
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
980
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
981
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
982
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
983
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
793
984
|
|
|
794
|
-
export async function authorise (hook) {
|
|
795
|
-
|
|
985
|
+
export <span class="fstat-no" title="function not covered" >async function authorise (hook) {</span>
|
|
986
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
796
987
|
<span class="cstat-no" title="statement not covered" > throw new Error('The \'authorise\' hook should only be used as a \'before\' hook.')</span>
|
|
797
988
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
798
|
-
const operation = hook.method
|
|
799
|
-
const resourceType = hook.service.name
|
|
800
|
-
debug('Provider is', hook.params.provider)
|
|
801
|
-
if (hook.params.user) debug('User is', hook.params.user)
|
|
802
|
-
debug('Operation is', operation)
|
|
803
|
-
if (resourceType) debug('Resource type is', resourceType)
|
|
804
|
-
|
|
805
|
-
// If called internally we skip authorisation
|
|
806
|
-
let checkAuthorisation = _.has(hook.params, 'provider')
|
|
807
|
-
debug('Access check ' + (checkAuthorisation ? 'enabled' : 'disabled') + ' for provider')
|
|
808
|
-
// If already checked we skip authorisation
|
|
809
|
-
if (hook.params.authorised) {
|
|
810
|
-
debug('Access already granted')
|
|
811
|
-
checkAuthorisation = false
|
|
812
|
-
}
|
|
813
|
-
// We also skip authorisation for built-in Feathers services like authentication
|
|
814
|
-
if (typeof hook.service.getPath !== 'function') {
|
|
815
|
-
debug('Access disabled on built-in services')
|
|
816
|
-
checkAuthorisation = false
|
|
817
|
-
}
|
|
818
|
-
// And if the authentication strategy is API key
|
|
819
|
-
if (_.get(hook, 'params.connection.authentication.strategy') === 'api')
|
|
989
|
+
<span class="cstat-no" title="statement not covered" > const operation = hook.method</span>
|
|
990
|
+
<span class="cstat-no" title="statement not covered" > const resourceType = hook.service.name</span>
|
|
991
|
+
<span class="cstat-no" title="statement not covered" > debug('Provider is', hook.params.provider)</span>
|
|
992
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.user) debug('User is', hook.params.user)</span>
|
|
993
|
+
<span class="cstat-no" title="statement not covered" > debug('Operation is', operation)</span>
|
|
994
|
+
<span class="cstat-no" title="statement not covered" > if (resourceType) debug('Resource type is', resourceType)</span>
|
|
995
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
996
|
+
<span class="cstat-no" title="statement not covered" > // If called internally we skip authorisation</span>
|
|
997
|
+
<span class="cstat-no" title="statement not covered" > let checkAuthorisation = _.has(hook.params, 'provider')</span>
|
|
998
|
+
<span class="cstat-no" title="statement not covered" > debug('Access check ' + (checkAuthorisation ? 'enabled' : 'disabled') + ' for provider')</span>
|
|
999
|
+
<span class="cstat-no" title="statement not covered" > // If already checked we skip authorisation</span>
|
|
1000
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.authorised) {</span>
|
|
1001
|
+
<span class="cstat-no" title="statement not covered" > debug('Access already granted')</span>
|
|
1002
|
+
<span class="cstat-no" title="statement not covered" > checkAuthorisation = false</span>
|
|
1003
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1004
|
+
<span class="cstat-no" title="statement not covered" > // We also skip authorisation for built-in Feathers services like authentication</span>
|
|
1005
|
+
<span class="cstat-no" title="statement not covered" > if (typeof hook.service.getPath !== 'function') {</span>
|
|
1006
|
+
<span class="cstat-no" title="statement not covered" > debug('Access disabled on built-in services')</span>
|
|
1007
|
+
<span class="cstat-no" title="statement not covered" > checkAuthorisation = false</span>
|
|
1008
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1009
|
+
<span class="cstat-no" title="statement not covered" > // And if the authentication strategy is API key</span>
|
|
1010
|
+
<span class="cstat-no" title="statement not covered" > if (_.get(hook, 'params.connection.authentication.strategy') === 'api') {</span>
|
|
820
1011
|
<span class="cstat-no" title="statement not covered" > debug('Access disabled on API keys')</span>
|
|
821
1012
|
<span class="cstat-no" title="statement not covered" > checkAuthorisation = false</span>
|
|
822
1013
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
823
|
-
// If explicitely asked to perform/skip, override defaults
|
|
824
|
-
if (_.has(hook.params, 'checkAuthorisation')) {
|
|
825
|
-
checkAuthorisation = _.get(hook.params, 'checkAuthorisation')
|
|
826
|
-
// Bypass authorisation for next hooks otherwise we will loop infinitely
|
|
827
|
-
delete hook.params.checkAuthorisation
|
|
828
|
-
debug('Access check ' + (checkAuthorisation ? 'forced' : 'unforced'))
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
const context = hook.service.context
|
|
832
|
-
if (checkAuthorisation) {
|
|
833
|
-
// Build ability for user
|
|
834
|
-
const authorisationService = hook.app.getService('authorisations')
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
if (
|
|
838
|
-
|
|
839
|
-
//
|
|
840
|
-
|
|
1014
|
+
<span class="cstat-no" title="statement not covered" > // If explicitely asked to perform/skip, override defaults</span>
|
|
1015
|
+
<span class="cstat-no" title="statement not covered" > if (_.has(hook.params, 'checkAuthorisation')) {</span>
|
|
1016
|
+
<span class="cstat-no" title="statement not covered" > checkAuthorisation = _.get(hook.params, 'checkAuthorisation')</span>
|
|
1017
|
+
<span class="cstat-no" title="statement not covered" > // Bypass authorisation for next hooks otherwise we will loop infinitely</span>
|
|
1018
|
+
<span class="cstat-no" title="statement not covered" > delete hook.params.checkAuthorisation</span>
|
|
1019
|
+
<span class="cstat-no" title="statement not covered" > debug('Access check ' + (checkAuthorisation ? 'forced' : 'unforced'))</span>
|
|
1020
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1021
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1022
|
+
<span class="cstat-no" title="statement not covered" > const context = hook.service.context</span>
|
|
1023
|
+
<span class="cstat-no" title="statement not covered" > if (checkAuthorisation) {</span>
|
|
1024
|
+
<span class="cstat-no" title="statement not covered" > // Build ability for user</span>
|
|
1025
|
+
<span class="cstat-no" title="statement not covered" > const authorisationService = hook.app.getService('authorisations')</span>
|
|
1026
|
+
<span class="cstat-no" title="statement not covered" > // If no user we allow for a stateless token with permissions inside</span>
|
|
1027
|
+
<span class="cstat-no" title="statement not covered" > let subject = hook.params.user</span>
|
|
1028
|
+
<span class="cstat-no" title="statement not covered" > if (!subject) {</span>
|
|
1029
|
+
<span class="cstat-no" title="statement not covered" > const payload = _.get(hook.params, 'authentication.payload')</span>
|
|
1030
|
+
<span class="cstat-no" title="statement not covered" > // Token targeting API gateway (sub = keyId) or app used through iframe (appId = keyId)</span>
|
|
1031
|
+
<span class="cstat-no" title="statement not covered" > if (payload && (payload.sub || payload.appId)) {</span>
|
|
841
1032
|
<span class="cstat-no" title="statement not covered" > subject = Object.assign({ _id: (payload.sub || payload.appId) }, payload)</span>
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
//
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
debug('Target resource is ', resource)
|
|
865
|
-
if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
1033
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1034
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1035
|
+
<span class="cstat-no" title="statement not covered" > const abilities = await authorisationService.getAbilities(subject)</span>
|
|
1036
|
+
<span class="cstat-no" title="statement not covered" > hook.params.abilities = abilities</span>
|
|
1037
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.user) debug('User abilities are', abilities.rules)</span>
|
|
1038
|
+
<span class="cstat-no" title="statement not covered" > else debug('Stateless abilities are', abilities.rules)</span>
|
|
1039
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1040
|
+
<span class="cstat-no" title="statement not covered" > // Check for access to service fisrt</span>
|
|
1041
|
+
<span class="cstat-no" title="statement not covered" > if (!hasServiceAbilities(abilities, hook.service)) {</span>
|
|
1042
|
+
<span class="cstat-no" title="statement not covered" > debug('Service access not granted')</span>
|
|
1043
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to access service ${hook.service.getPath()}`)</span>
|
|
1044
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1045
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1046
|
+
<span class="cstat-no" title="statement not covered" > if (!hook.id) {</span>
|
|
1047
|
+
<span class="cstat-no" title="statement not covered" > // In this specific case there is no query to be run,</span>
|
|
1048
|
+
<span class="cstat-no" title="statement not covered" > // simply check against the object we'd like to create</span>
|
|
1049
|
+
<span class="cstat-no" title="statement not covered" > // Support custom methods as create operation as they have similar signature</span>
|
|
1050
|
+
<span class="cstat-no" title="statement not covered" > const DEFAULT_METHODS = ['find', 'get', 'create', 'update', 'patch', 'remove']</span>
|
|
1051
|
+
<span class="cstat-no" title="statement not covered" > if ((operation === 'create') || !DEFAULT_METHODS.includes(operation)) {</span>
|
|
1052
|
+
<span class="cstat-no" title="statement not covered" > const resource = hook.data</span>
|
|
1053
|
+
<span class="cstat-no" title="statement not covered" > debug('Target resource is ', resource)</span>
|
|
1054
|
+
<span class="cstat-no" title="statement not covered" > if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) {</span>
|
|
866
1055
|
<span class="cstat-no" title="statement not covered" > debug('Resource access not granted')</span>
|
|
867
1056
|
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)</span>
|
|
868
1057
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
869
|
-
} else {
|
|
870
|
-
// When we find/update/patch/remove multiple items this ensures that
|
|
871
|
-
// only the ones authorised by constraints on the resources will be fetched
|
|
872
|
-
// This avoid fetching all first then check it one by one
|
|
873
|
-
const dbQuery = objectifyIDs(getQueryForAbilities(abilities, operation, resourceType))
|
|
874
|
-
if (dbQuery) {
|
|
875
|
-
hook.params.query = _.transform(hook.params.query, (result, value, key) => {
|
|
876
|
-
|
|
877
|
-
else result[key] = value
|
|
878
|
-
}, {})
|
|
879
|
-
_.merge(hook.params.query, dbQuery)
|
|
880
|
-
|
|
1058
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
1059
|
+
<span class="cstat-no" title="statement not covered" > // When we find/update/patch/remove multiple items this ensures that</span>
|
|
1060
|
+
<span class="cstat-no" title="statement not covered" > // only the ones authorised by constraints on the resources will be fetched</span>
|
|
1061
|
+
<span class="cstat-no" title="statement not covered" > // This avoid fetching all first then check it one by one</span>
|
|
1062
|
+
<span class="cstat-no" title="statement not covered" > const dbQuery = objectifyIDs(getQueryForAbilities(abilities, operation, resourceType))</span>
|
|
1063
|
+
<span class="cstat-no" title="statement not covered" > if (dbQuery) {</span>
|
|
1064
|
+
<span class="cstat-no" title="statement not covered" > hook.params.query = _.transform(hook.params.query, (result, value, key) => {</span>
|
|
1065
|
+
<span class="cstat-no" title="statement not covered" > if (key === '$or') result.$and = [{ $or: value }]</span>
|
|
1066
|
+
<span class="cstat-no" title="statement not covered" > else result[key] = value</span>
|
|
1067
|
+
<span class="cstat-no" title="statement not covered" > }, {})</span>
|
|
1068
|
+
<span class="cstat-no" title="statement not covered" > _.merge(hook.params.query, dbQuery)</span>
|
|
1069
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
881
1070
|
<span class="cstat-no" title="statement not covered" > if (operation === 'find') { // You don't have right to read any items but you have access to the service so the result is empty</span>
|
|
882
1071
|
<span class="cstat-no" title="statement not covered" > hook.result = (!_.get(hook, 'params.paginate', true) ? [] : { total: 0, skip: 0, data: [] })</span>
|
|
883
1072
|
<span class="cstat-no" title="statement not covered" > } else { // You don't have the right to update/patch/remove any items so any tentative should throw</span>
|
|
@@ -885,57 +1074,153 @@ export async function authorise (hook) {
|
|
|
885
1074
|
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)</span>
|
|
886
1075
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
887
1076
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
888
|
-
}
|
|
889
|
-
debug('Resource access granted')
|
|
890
|
-
// Some specific services might not expose a get function, in this case we cannot check for authorisation
|
|
891
|
-
// this has to be implemented by the service itself
|
|
892
|
-
} else if (typeof hook.service.get === 'function') {
|
|
893
|
-
// In this case (single get/update/patch/remove) we need to fetch the item first
|
|
894
|
-
// Take care we might have additional query parameters to be "catched" by before hooks
|
|
895
|
-
// however at this stage these query parameters might cause get to fail
|
|
896
|
-
const params = Object.assign({ checkAuthorisation: false }, hook.params)
|
|
897
|
-
_.unset(params, 'query')
|
|
898
|
-
const resource = await hook.service.get(hook.id, params)
|
|
899
|
-
debug('Target resource is', resource)
|
|
900
|
-
// Then check against the object we'd like to manage
|
|
901
|
-
if (!hasResourceAbilities(abilities, operation, resourceType, context, resource))
|
|
1077
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1078
|
+
<span class="cstat-no" title="statement not covered" > debug('Resource access granted')</span>
|
|
1079
|
+
<span class="cstat-no" title="statement not covered" > // Some specific services might not expose a get function, in this case we cannot check for authorisation</span>
|
|
1080
|
+
<span class="cstat-no" title="statement not covered" > // this has to be implemented by the service itself</span>
|
|
1081
|
+
<span class="cstat-no" title="statement not covered" > } else if (typeof hook.service.get === 'function') {</span>
|
|
1082
|
+
<span class="cstat-no" title="statement not covered" > // In this case (single get/update/patch/remove) we need to fetch the item first</span>
|
|
1083
|
+
<span class="cstat-no" title="statement not covered" > // Take care we might have additional query parameters to be "catched" by before hooks,</span>
|
|
1084
|
+
<span class="cstat-no" title="statement not covered" > // however at this stage these query parameters might cause get to fail</span>
|
|
1085
|
+
<span class="cstat-no" title="statement not covered" > const params = Object.assign({ checkAuthorisation: false }, hook.params)</span>
|
|
1086
|
+
<span class="cstat-no" title="statement not covered" > _.unset(params, 'query')</span>
|
|
1087
|
+
<span class="cstat-no" title="statement not covered" > const resource = await hook.service.get(hook.id, params)</span>
|
|
1088
|
+
<span class="cstat-no" title="statement not covered" > debug('Target resource is', resource)</span>
|
|
1089
|
+
<span class="cstat-no" title="statement not covered" > // Then check against the object we'd like to manage</span>
|
|
1090
|
+
<span class="cstat-no" title="statement not covered" > if (!hasResourceAbilities(abilities, operation, resourceType, context, resource)) {</span>
|
|
902
1091
|
<span class="cstat-no" title="statement not covered" > debug('Resource access not granted')</span>
|
|
903
1092
|
<span class="cstat-no" title="statement not covered" > throw new Forbidden(`You are not allowed to perform ${operation} operation on ${resourceType}`)</span>
|
|
904
1093
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
905
|
-
// Avoid fetching again the object in this case
|
|
906
|
-
if (operation === 'get') {
|
|
907
|
-
hook.result = resource
|
|
908
|
-
}
|
|
909
|
-
hook.params.authorised = true
|
|
910
|
-
debug('Resource access granted')
|
|
911
|
-
return hook
|
|
912
|
-
}
|
|
913
|
-
} else {
|
|
914
|
-
debug('Authorisation check skipped, access granted')
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
hook.params.authorised = true
|
|
918
|
-
return hook
|
|
919
|
-
}
|
|
1094
|
+
<span class="cstat-no" title="statement not covered" > // Avoid fetching again the object in this case</span>
|
|
1095
|
+
<span class="cstat-no" title="statement not covered" > if (operation === 'get') {</span>
|
|
1096
|
+
<span class="cstat-no" title="statement not covered" > hook.result = resource</span>
|
|
1097
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1098
|
+
<span class="cstat-no" title="statement not covered" > hook.params.authorised = true</span>
|
|
1099
|
+
<span class="cstat-no" title="statement not covered" > debug('Resource access granted')</span>
|
|
1100
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1101
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1102
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
1103
|
+
<span class="cstat-no" title="statement not covered" > debug('Authorisation check skipped, access granted')</span>
|
|
1104
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1105
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1106
|
+
<span class="cstat-no" title="statement not covered" > hook.params.authorised = true</span>
|
|
1107
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1108
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
920
1109
|
|
|
921
1110
|
export function updateAbilities (options = {}) {
|
|
922
1111
|
return async function (hook) {
|
|
923
|
-
const app = hook.app
|
|
924
|
-
const params = hook.params
|
|
925
|
-
const authorisationService = app.getService('authorisations')
|
|
926
|
-
let subject = (options.subjectAsItem ? getItems(hook)
|
|
927
|
-
// Specific case of authentication result
|
|
928
|
-
|
|
929
|
-
// We might not have all information required eg on patch to compute new abilities
|
|
930
|
-
// in this case we have to fetch the whole subject
|
|
931
|
-
if (options.fetchSubject) {
|
|
932
|
-
subject = await app.getService('users').get(subject._id.toString())
|
|
933
|
-
}
|
|
934
|
-
await authorisationService.updateAbilities(subject)
|
|
935
|
-
|
|
936
|
-
|
|
1112
|
+
<span class="cstat-no" title="statement not covered" > const app = hook.app</span>
|
|
1113
|
+
<span class="cstat-no" title="statement not covered" > const params = hook.params</span>
|
|
1114
|
+
<span class="cstat-no" title="statement not covered" > const authorisationService = app.getService('authorisations')</span>
|
|
1115
|
+
<span class="cstat-no" title="statement not covered" > let subject = (options.subjectAsItem ? getItems(hook) : params.user)</span>
|
|
1116
|
+
<span class="cstat-no" title="statement not covered" > // Specific case of authentication result</span>
|
|
1117
|
+
<span class="cstat-no" title="statement not covered" > if (subject && subject.user) subject = subject.user</span>
|
|
1118
|
+
<span class="cstat-no" title="statement not covered" > // We might not have all information required eg on patch to compute new abilities,</span>
|
|
1119
|
+
<span class="cstat-no" title="statement not covered" > // in this case we have to fetch the whole subject</span>
|
|
1120
|
+
<span class="cstat-no" title="statement not covered" > if (options.fetchSubject) {</span>
|
|
1121
|
+
<span class="cstat-no" title="statement not covered" > subject = await app.getService('users').get(subject._id.toString())</span>
|
|
1122
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1123
|
+
<span class="cstat-no" title="statement not covered" > const abilities = await authorisationService.updateAbilities(subject)</span>
|
|
1124
|
+
<span class="cstat-no" title="statement not covered" > debug('Abilities updated on subject', subject, abilities.rules)</span>
|
|
1125
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1126
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
937
1127
|
}
|
|
938
1128
|
|
|
1129
|
+
export <span class="fstat-no" title="function not covered" >function preventRemovingLastOwner (resourceScope) {</span>
|
|
1130
|
+
<span class="cstat-no" title="statement not covered" > return async function (hook) {</span>
|
|
1131
|
+
<span class="cstat-no" title="statement not covered" > // By pass check ?</span>
|
|
1132
|
+
<span class="cstat-no" title="statement not covered" > if (hook.params.force) return hook</span>
|
|
1133
|
+
<span class="cstat-no" title="statement not covered" > const params = hook.params</span>
|
|
1134
|
+
<span class="cstat-no" title="statement not covered" > const data = hook.data || {}</span>
|
|
1135
|
+
<span class="cstat-no" title="statement not covered" > const query = params.query || {}</span>
|
|
1136
|
+
<span class="cstat-no" title="statement not covered" > const scope = data.scope || query.scope</span>
|
|
1137
|
+
<span class="cstat-no" title="statement not covered" > const grantedPermissions = data.permissions || query.permissions</span>
|
|
1138
|
+
<span class="cstat-no" title="statement not covered" > const grantedRole = (grantedPermissions ? Roles[grantedPermissions] : undefined)</span>
|
|
1139
|
+
<span class="cstat-no" title="statement not covered" > const resource = hook.params.resource</span>
|
|
1140
|
+
<span class="cstat-no" title="statement not covered" > const subjects = hook.params.subjects</span>
|
|
1141
|
+
<span class="cstat-no" title="statement not covered" > const subjectService = hook.params.subjectsService</span>
|
|
1142
|
+
<span class="cstat-no" title="statement not covered" > // On create check if we try to downgrade permissions otherwise let pass through</span>
|
|
1143
|
+
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(grantedRole) && (grantedRole === Roles.owner)) return hook</span>
|
|
1144
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1145
|
+
<span class="cstat-no" title="statement not covered" > if ((scope === resourceScope) && resource && resource._id) {</span>
|
|
1146
|
+
<span class="cstat-no" title="statement not covered" > // Count existing owners</span>
|
|
1147
|
+
<span class="cstat-no" title="statement not covered" > const owners = await countSubjectsForResource(subjectService, resourceScope, resource._id, Roles.owner)</span>
|
|
1148
|
+
<span class="cstat-no" title="statement not covered" > // Now count owners we change/remove permissions on</span>
|
|
1149
|
+
<span class="cstat-no" title="statement not covered" > const removedOwners = subjects.reduce((count, subject) => {</span>
|
|
1150
|
+
<span class="cstat-no" title="statement not covered" > const resources = _.get(subject, resourceScope, [])</span>
|
|
1151
|
+
<span class="cstat-no" title="statement not covered" > const ownedResource = _.find(resources, { _id: resource._id, permissions: RoleNames[Roles.owner] })</span>
|
|
1152
|
+
<span class="cstat-no" title="statement not covered" > return (ownedResource ? count + 1 : count)</span>
|
|
1153
|
+
<span class="cstat-no" title="statement not covered" > }, 0)</span>
|
|
1154
|
+
<span class="cstat-no" title="statement not covered" > // If none remains stop</span>
|
|
1155
|
+
<span class="cstat-no" title="statement not covered" > if (removedOwners >= owners.total) {</span>
|
|
1156
|
+
<span class="cstat-no" title="statement not covered" > debug('Cannot remove the last owner of resource ', resource)</span>
|
|
1157
|
+
<span class="cstat-no" title="statement not covered" > const resourceName = resource.name ? resource.name : resource._id.toString()</span>
|
|
1158
|
+
<span class="cstat-no" title="statement not covered" > throw new Forbidden('You are not allowed to remove the last owner of resource ' + resourceName, {</span>
|
|
1159
|
+
<span class="cstat-no" title="statement not covered" > translation: {</span>
|
|
1160
|
+
<span class="cstat-no" title="statement not covered" > key: 'CANNOT_REMOVE_LAST_OWNER',</span>
|
|
1161
|
+
<span class="cstat-no" title="statement not covered" > params: { resource: resourceName }</span>
|
|
1162
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1163
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1164
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1165
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1166
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1167
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1168
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
1169
|
+
|
|
1170
|
+
export <span class="fstat-no" title="function not covered" >async function removeOrganisationGroupsAuthorisations (hook) {</span>
|
|
1171
|
+
<span class="cstat-no" title="statement not covered" > const app = hook.app</span>
|
|
1172
|
+
<span class="cstat-no" title="statement not covered" > const authorisationService = app.getService('authorisations')</span>
|
|
1173
|
+
<span class="cstat-no" title="statement not covered" > const org = hook.params.resource</span>
|
|
1174
|
+
<span class="cstat-no" title="statement not covered" > const user = hook.params.user</span>
|
|
1175
|
+
<span class="cstat-no" title="statement not covered" > // Unset membership for the all org groups</span>
|
|
1176
|
+
<span class="cstat-no" title="statement not covered" > const orgGroupService = app.getService('groups', org)</span>
|
|
1177
|
+
<span class="cstat-no" title="statement not covered" > const groups = await orgGroupService.find({ paginate: false })</span>
|
|
1178
|
+
<span class="cstat-no" title="statement not covered" > await Promise.all(groups.map(group => {</span>
|
|
1179
|
+
<span class="cstat-no" title="statement not covered" > // Unset membership on group for the all org users</span>
|
|
1180
|
+
<span class="cstat-no" title="statement not covered" > return authorisationService.remove(group._id.toString(), {</span>
|
|
1181
|
+
<span class="cstat-no" title="statement not covered" > query: {</span>
|
|
1182
|
+
<span class="cstat-no" title="statement not covered" > scope: 'groups'</span>
|
|
1183
|
+
<span class="cstat-no" title="statement not covered" > },</span>
|
|
1184
|
+
<span class="cstat-no" title="statement not covered" > user,</span>
|
|
1185
|
+
<span class="cstat-no" title="statement not covered" > force: hook.params.force,</span>
|
|
1186
|
+
<span class="cstat-no" title="statement not covered" > // Because we already have resource set it as objects to avoid populating</span>
|
|
1187
|
+
<span class="cstat-no" title="statement not covered" > // Moreover used as an after hook the resource might not already exist anymore</span>
|
|
1188
|
+
<span class="cstat-no" title="statement not covered" > subjects: hook.params.subjects,</span>
|
|
1189
|
+
<span class="cstat-no" title="statement not covered" > subjectsService: hook.params.subjectsService,</span>
|
|
1190
|
+
<span class="cstat-no" title="statement not covered" > resource: group,</span>
|
|
1191
|
+
<span class="cstat-no" title="statement not covered" > resourcesService: orgGroupService</span>
|
|
1192
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1193
|
+
<span class="cstat-no" title="statement not covered" > }))</span>
|
|
1194
|
+
<span class="cstat-no" title="statement not covered" > debug('Authorisations unset on groups for organisation ' + org._id)</span>
|
|
1195
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1196
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
1197
|
+
|
|
1198
|
+
export <span class="fstat-no" title="function not covered" >async function removeOrganisationTagsAuthorisations (hook) {</span>
|
|
1199
|
+
<span class="cstat-no" title="statement not covered" > const app = hook.app</span>
|
|
1200
|
+
<span class="cstat-no" title="statement not covered" > const org = hook.params.resource</span>
|
|
1201
|
+
<span class="cstat-no" title="statement not covered" > const subjectService = hook.params.subjectsService</span>
|
|
1202
|
+
<span class="cstat-no" title="statement not covered" > const orgTagsService = app.getService('tags', org)</span>
|
|
1203
|
+
<span class="cstat-no" title="statement not covered" > const subjects = hook.params.subjects || []</span>
|
|
1204
|
+
<span class="cstat-no" title="statement not covered" > if (subjects.length === 0) return hook</span>
|
|
1205
|
+
<span class="cstat-no" title="statement not covered" > // Retrieve org tags</span>
|
|
1206
|
+
<span class="cstat-no" title="statement not covered" > const orgTags = await orgTagsService.find({ paginate: false })</span>
|
|
1207
|
+
<span class="cstat-no" title="statement not covered" > const promises = []</span>
|
|
1208
|
+
<span class="cstat-no" title="statement not covered" > subjects.forEach(subject => {</span>
|
|
1209
|
+
<span class="cstat-no" title="statement not covered" > const tags = subject.tags || []</span>
|
|
1210
|
+
<span class="cstat-no" title="statement not covered" > // Find tags from org</span>
|
|
1211
|
+
<span class="cstat-no" title="statement not covered" > const fromOrg = _.intersectionWith(tags, orgTags, isTagEqual)</span>
|
|
1212
|
+
<span class="cstat-no" title="statement not covered" > // Clear removed tags</span>
|
|
1213
|
+
<span class="cstat-no" title="statement not covered" > const notFromOrg = _.differenceWith(tags, orgTags, isTagEqual)</span>
|
|
1214
|
+
<span class="cstat-no" title="statement not covered" > // Update subject if required</span>
|
|
1215
|
+
<span class="cstat-no" title="statement not covered" > if (fromOrg.length > 0) {</span>
|
|
1216
|
+
<span class="cstat-no" title="statement not covered" > promises.push(subjectService.patch(subject._id.toString(), { tags: notFromOrg }))</span>
|
|
1217
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1218
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1219
|
+
<span class="cstat-no" title="statement not covered" > // Perform subject updates in parallel</span>
|
|
1220
|
+
<span class="cstat-no" title="statement not covered" > await Promise.all(promises)</span>
|
|
1221
|
+
<span class="cstat-no" title="statement not covered" > debug(`Tags unset on ${promises.length} subjects for organisation ` + org._id)</span>
|
|
1222
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1223
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
939
1224
|
</pre></td></tr></table></pre>
|
|
940
1225
|
|
|
941
1226
|
<div class='push'></div><!-- for sticky footer -->
|
|
@@ -943,7 +1228,7 @@ export function updateAbilities (options = {}) {
|
|
|
943
1228
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
944
1229
|
Code coverage generated by
|
|
945
1230
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
946
|
-
at
|
|
1231
|
+
at 2024-08-13T10:02:04.872Z
|
|
947
1232
|
</div>
|
|
948
1233
|
<script src="../../../prettify.js"></script>
|
|
949
1234
|
<script>
|