Skip to content
Snippets Groups Projects
Unverified Commit 4b56db3b authored by Sebastian Castro's avatar Sebastian Castro
Browse files

map edit: provide liste of readonly sources

parent 071681da
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,15 @@ class GoGoCartoJsService ...@@ -45,6 +45,15 @@ class GoGoCartoJsService
} }
} }
$readonlySources = $this->dm->query('ImportDynamic')
->field('isSynchronized')->notEqual(true)
->select('sourceName')->getArray();
$editFeatureConf = [
'options' => ['readonlySources' => array_values($readonlySources)]
];
if (!$config->getEditFeature()->isOnlyAllowedForAdmin()) {
$editFeatureConf['roles'] = ['anonymous', 'user', 'admin'];
}
$result = [ $result = [
'security' => [ 'security' => [
'userRoles' => $userGogocartoRole, 'userRoles' => $userGogocartoRole,
...@@ -153,7 +162,7 @@ class GoGoCartoJsService ...@@ -153,7 +162,7 @@ class GoGoCartoJsService
'edit' => $this->getConfigFrom( 'edit' => $this->getConfigFrom(
$config->getEditFeature(), $config->getEditFeature(),
'gogo_element_edit', 'gogo_element_edit',
$config->getEditFeature()->isOnlyAllowedForAdmin() ? [] : ['roles' => ['anonymous', 'user', 'admin']] $editFeatureConf
), ),
'delete' => $this->getConfigFrom($config->getDeleteFeature(), 'gogo_delete_element'), 'delete' => $this->getConfigFrom($config->getDeleteFeature(), 'gogo_delete_element'),
'sendMail' => [ 'url' => $this->getAbsolutePath('gogo_element_send_mail') ], 'sendMail' => [ 'url' => $this->getAbsolutePath('gogo_element_send_mail') ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment