Skip to content

Commit 686bcd8

Browse files
committed
Don't crash if permissions list attributes which don't exist in the corresponding resource
1 parent 9a71f6c commit 686bcd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ogc_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ def service_permissions(self, identity, service_name, ows_type):
342342
if layer_resource.get('queryable', False):
343343
permitted_layer['queryable'] |= layer_permission.get('queryable', False)
344344
# add permitted attributes
345-
permitted_layer['attributes'].update(
346-
dict(map(lambda attr: (attr, layer_resource['attributes'][attr]), layer_permission.get('attributes', [])))
347-
)
345+
for attr in layer_permission.get('attributes', []):
346+
if attr in layer_resource['attributes']:
347+
permitted_layer['attributes'][attr] = layer_resource['attributes'][attr]
348348

349349
# collect permitted print templates
350350
permitted_print_templates.update(permissions.get('print_templates', []))

0 commit comments

Comments
 (0)