|
|
@@ -231,6 +231,42 @@ class Schema_SystemObjectStorageAcl extends Core_AclSimpleSchemaBase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if ($activeProject = Config::getProjectPath()) {
|
|
|
+ $baseAntObjectPath = "{$activeProject}/schema/ant-object";
|
|
|
+ DBG::nicePrint($baseAntObjectPath, "\$baseAntObjectPath");
|
|
|
+ foreach (glob("{$baseAntObjectPath}/*/*/build.xml", GLOB_NOSORT) as $file) {
|
|
|
+ // SE/schema/ant-object/default_db.test_perms/TestPermsAnt/build.xml
|
|
|
+ $file = substr($file, strlen("{$baseAntObjectPath}/"), -1 * strlen('/build.xml'));
|
|
|
+ DBG::nicePrint($file, '$file');
|
|
|
+ list($partSource, $name) = explode('/', $file);
|
|
|
+ list($sourceName, $rootTableName) = explode('.', $partSource);
|
|
|
+ DBG::nicePrint([$sourceName, $rootTableName, $name], '[$lowerSource, $rootTableName, $name]');
|
|
|
+ // $clsName = substr(basename($file), 0, -1 * strlen('StorageAcl.php'));
|
|
|
+ try {
|
|
|
+ Lib::loadClass('AntAclBase');
|
|
|
+ $acl = AntAclBase::buildInstance(0, [
|
|
|
+ 'source' => $sourceName,
|
|
|
+ 'rootTableName' => $rootTableName,
|
|
|
+ 'name' => $name
|
|
|
+ ]);
|
|
|
+ // $acl = SchemaFactory::loadDefaultObject($clsName);
|
|
|
+ // $namespace = $acl->getNamespace();
|
|
|
+ // $name = $acl->getName();
|
|
|
+ $idDatabase = DB::getPDO($sourceName)->getZasobId();
|
|
|
+ $namespace = "{$sourceName}/{$rootTableName}/{$name}";
|
|
|
+ DB::getPDO()->insertOrUpdate($this->_rootTableName, [
|
|
|
+ 'namespace' => $namespace,
|
|
|
+ 'idDatabase' => $idDatabase,
|
|
|
+ '_type' => "AntAcl",
|
|
|
+ '_rootTableName' => $rootTableName,
|
|
|
+ 'hasStruct' => 1
|
|
|
+ ]);
|
|
|
+ } catch (Exception $e) {
|
|
|
+ UI::alert('danger', $e->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Fix objects AntAcl which struct is not installed
|
|
|
$listAntAclObjectsToFix = DB::getPDO()->fetchAll("
|
|
|
select t.*
|