|
|
@@ -756,6 +756,13 @@ class Route_Storage extends RouteBase {
|
|
|
if (empty($objectItem)) throw new Exception("SystemObject '{$namespace}' not found");
|
|
|
DBG::log($objectItem, 'array', 'object acl $objectItem');
|
|
|
|
|
|
+ try {
|
|
|
+ $acl = User::getAcl()->getObjectAcl('default_db', 'crm_lista_zasobow');
|
|
|
+ } catch (Exception $e) {
|
|
|
+ DBG::log($e);
|
|
|
+ throw new Exception("Brak dostępu do tabeli Zasoby");
|
|
|
+ }
|
|
|
+
|
|
|
if ($objectItem['idZasob'] > 0) {
|
|
|
// TODO: check if realy exists? @see SchemaFactory::loadDefaultObject('SystemObject')::updateCache()
|
|
|
return [
|
|
|
@@ -796,13 +803,6 @@ class Route_Storage extends RouteBase {
|
|
|
];
|
|
|
}
|
|
|
|
|
|
- try {
|
|
|
- $acl = User::getAcl()->getObjectAcl('default_db', 'crm_lista_zasobow');
|
|
|
- } catch (Exception $e) {
|
|
|
- DBG::log($e);
|
|
|
- throw new Exception("Brak dostępu do tabeli Zasoby");
|
|
|
- }
|
|
|
-
|
|
|
if (empty($objectItem['idDatabase'])) throw new Exception("Missing database id");
|
|
|
if ($idStorage != $objectItem['idDatabase']) throw new Exception("Database id must be the same");
|
|
|
if (empty($objectItem['_rootTableName'])) throw new Exception("Missing root table name");
|
|
|
@@ -893,12 +893,15 @@ class Route_Storage extends RouteBase {
|
|
|
$response->_replaceButtonNode = "[{$createdId}]";
|
|
|
throw new AlertSuccessException("Utworzono pomyślnie rekord nr {$createdId}");
|
|
|
} catch (AlertSuccessException $e) {
|
|
|
+ DBG::log($e);
|
|
|
$response->type = 'success';
|
|
|
$response->msg = $e->getMessage();
|
|
|
} catch (AlertInfoException $e) {
|
|
|
+ DBG::log($e);
|
|
|
$response->type = 'info';
|
|
|
$response->msg = $e->getMessage();
|
|
|
} catch (Exception $e) {
|
|
|
+ DBG::log($e);
|
|
|
$response->type = 'error';
|
|
|
$response->msg = $e->getMessage();
|
|
|
}
|