|
|
@@ -202,6 +202,43 @@ class Schema_SystemObjectStorageAcl extends Core_AclSimpleSchemaBase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // Ant objects in: SE/schema/ant-object/
|
|
|
+ foreach (glob(APP_PATH_SCHEMA . "/ant-object/*/*/build.xml", GLOB_NOSORT) as $file) {
|
|
|
+ // SE/schema/ant-object/default_db.test_perms/TestPermsAnt/build.xml
|
|
|
+ $file = substr($file, strlen(APP_PATH_SCHEMA . '/ant-object/'), -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();
|
|
|
+ $sqlNsPrefix = "{$sourceName}__x3A__{$rootTableName}";
|
|
|
+ $sqlName = $name;
|
|
|
+ DB::getPDO()->execSql("
|
|
|
+ insert ignore into `{$this->_rootTableName}` (nsPrefix, idDatabase, _type, name, description, isActive)
|
|
|
+ values (
|
|
|
+ '{$sqlNsPrefix}'
|
|
|
+ , '0'
|
|
|
+ , 'AntAcl'
|
|
|
+ , '{$sqlName}'
|
|
|
+ , ''
|
|
|
+ , '1'
|
|
|
+ )
|
|
|
+ ");
|
|
|
+ } catch (Exception $e) {
|
|
|
+ UI::alert('danger', $e->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// // foreach ... DB::getPDO($idDatabase)->fetchAll(select real _rootTableName)
|
|
|
// foreach (Core_AclHelper::getAclList() as $typeName) {
|
|
|
// $ns = Core_AclHelper::parseTypeName($typeName);
|