diff --git a/src/Services/GoGoCartoJsService.php b/src/Services/GoGoCartoJsService.php index f1363b915f07df7e2e77a67f83d68108a00841e9..97668dd442e1fe45ce402b23f4e363b44f2be0bb 100644 --- a/src/Services/GoGoCartoJsService.php +++ b/src/Services/GoGoCartoJsService.php @@ -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 = [ 'security' => [ 'userRoles' => $userGogocartoRole, @@ -153,7 +162,7 @@ class GoGoCartoJsService 'edit' => $this->getConfigFrom( $config->getEditFeature(), 'gogo_element_edit', - $config->getEditFeature()->isOnlyAllowedForAdmin() ? [] : ['roles' => ['anonymous', 'user', 'admin']] + $editFeatureConf ), 'delete' => $this->getConfigFrom($config->getDeleteFeature(), 'gogo_delete_element'), 'sendMail' => [ 'url' => $this->getAbsolutePath('gogo_element_send_mail') ],