Skip to content

Commit c0eb551

Browse files
committed
Add permissions to upload params
1 parent 8d9052f commit c0eb551

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

geonode/geoserver/management/commands/importlayers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def __init__(
123123
self.skip_existing_layers = skip_existing_layers
124124
self.tentatives = tentatives
125125
self.handlers = BaseHandler.get_registry()
126+
self.action = str(ExecutionRequestAction.UPLOAD.value)
126127

127128
def execute(self):
128129
success, errors = [], []
@@ -203,7 +204,7 @@ def get_handler(self, file_path):
203204

204205
_data = {
205206
"base_file": file_path,
206-
"action": str(ExecutionRequestAction.UPLOAD.value),
207+
"action": self.action,
207208
}
208209
for handler_class in self.handlers:
209210
if handler_class.can_handle(_data):
@@ -279,8 +280,9 @@ def prepare_upload_params(self, file, file_path, required, optional):
279280
to upload (`files_to_upload`).
280281
"""
281282
params = {
282-
"action": str(ExecutionRequestAction.UPLOAD.value),
283+
"action": self.action,
283284
"dataset_title": file,
285+
"permissions": '{ "users": {"AnonymousUser": ["view_resourcebase"]} , "groups":{}}',
284286
"non_interactive": "true",
285287
"overwrite_existing_layer": str(self.overwrite_existing_layers).lower(),
286288
"skip_existing_layers": str(self.skip_existing_layers).lower(),

0 commit comments

Comments
 (0)