diff --git a/.claude/skills/role-compile/SKILL.md b/.claude/skills/role-compile/SKILL.md index 9f2513cc..f621024d 100644 --- a/.claude/skills/role-compile/SKILL.md +++ b/.claude/skills/role-compile/SKILL.md @@ -1,7 +1,7 @@ --- name: role-compile description: Создание роли 1С из описания прав. Используй когда нужно создать новую роль с набором прав на объекты -argument-hint: +argument-hint: allowed-tools: - Bash - Read @@ -18,13 +18,13 @@ allowed-tools: | Параметр | Описание | |----------|----------| | `JsonPath` | Путь к JSON-определению роли | -| `RolesDir` | Каталог `Roles/` в исходниках конфигурации | +| `OutputDir` | Корень выгрузки конфигурации (где `Configuration.xml`, `Roles/` и т.д.) | ```powershell -powershell.exe -NoProfile -File .claude/skills/role-compile/scripts/role-compile.ps1 -JsonPath "" -OutputDir "" +powershell.exe -NoProfile -File .claude/skills/role-compile/scripts/role-compile.ps1 -JsonPath "" -OutputDir "" ``` -`ИмяРоли` автоматически добавляется в `` файла `Configuration.xml` (ожидается в parent от `RolesDir`). +Создаёт `{OutputDir}/Roles/Имя.xml` и `{OutputDir}/Roles/Имя/Ext/Rights.xml`. Регистрирует `` в `Configuration.xml`. ## JSON DSL diff --git a/.claude/skills/role-compile/scripts/role-compile.ps1 b/.claude/skills/role-compile/scripts/role-compile.ps1 index 801df231..508ba64c 100644 --- a/.claude/skills/role-compile/scripts/role-compile.ps1 +++ b/.claude/skills/role-compile/scripts/role-compile.ps1 @@ -1,4 +1,4 @@ -# role-compile v1.2 — Compile 1C role from JSON +# role-compile v1.3 — Compile 1C role from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -615,14 +615,25 @@ $outDir = if ([System.IO.Path]::IsPathRooted($OutputDir)) { Join-Path (Get-Location) $OutputDir } -# Metadata: OutputDir/RoleName.xml -$metadataPath = Join-Path $outDir "$roleName.xml" -if (-not (Test-Path $outDir)) { - New-Item -ItemType Directory -Path $outDir -Force | Out-Null +# Determine Roles dir and config root +# Back-compat: if OutputDir leaf is "Roles", use as-is; otherwise treat as config root +$leaf = Split-Path $outDir -Leaf +if ($leaf -eq "Roles") { + $rolesDir = $outDir + $configDir = Split-Path $outDir -Parent +} else { + $rolesDir = Join-Path $outDir "Roles" + $configDir = $outDir } -# Rights: OutputDir/RoleName/Ext/Rights.xml -$roleSubDir = Join-Path $outDir $roleName +# Metadata: Roles/RoleName.xml +$metadataPath = Join-Path $rolesDir "$roleName.xml" +if (-not (Test-Path $rolesDir)) { + New-Item -ItemType Directory -Path $rolesDir -Force | Out-Null +} + +# Rights: Roles/RoleName/Ext/Rights.xml +$roleSubDir = Join-Path $rolesDir $roleName $extDir = Join-Path $roleSubDir "Ext" $rightsPath = Join-Path $extDir "Rights.xml" if (-not (Test-Path $extDir)) { @@ -635,7 +646,6 @@ $enc = New-Object System.Text.UTF8Encoding($true) # --- 12. Register in Configuration.xml --- -$configDir = Split-Path $outDir -Parent $configXmlPath = Join-Path $configDir "Configuration.xml" $regResult = $null diff --git a/.claude/skills/role-compile/scripts/role-compile.py b/.claude/skills/role-compile/scripts/role-compile.py index 13434215..65dca59f 100644 --- a/.claude/skills/role-compile/scripts/role-compile.py +++ b/.claude/skills/role-compile/scripts/role-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# role-compile v1.2 — Compile 1C role from JSON +# role-compile v1.3 — Compile 1C role from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -563,12 +563,22 @@ def main(): if not os.path.isabs(out_dir): out_dir = os.path.join(os.getcwd(), out_dir) - # Metadata: OutputDir/RoleName.xml - metadata_path = os.path.join(out_dir, f'{role_name}.xml') - os.makedirs(out_dir, exist_ok=True) + # Determine Roles dir and config root + # Back-compat: if OutputDir leaf is "Roles", use as-is; otherwise treat as config root + leaf = os.path.basename(out_dir.rstrip(os.sep).rstrip('/')) + if leaf == 'Roles': + roles_dir = out_dir + config_dir = os.path.dirname(out_dir) + else: + roles_dir = os.path.join(out_dir, 'Roles') + config_dir = out_dir - # Rights: OutputDir/RoleName/Ext/Rights.xml - role_sub_dir = os.path.join(out_dir, role_name) + # Metadata: Roles/RoleName.xml + metadata_path = os.path.join(roles_dir, f'{role_name}.xml') + os.makedirs(roles_dir, exist_ok=True) + + # Rights: Roles/RoleName/Ext/Rights.xml + role_sub_dir = os.path.join(roles_dir, role_name) ext_dir = os.path.join(role_sub_dir, 'Ext') rights_path = os.path.join(ext_dir, 'Rights.xml') os.makedirs(ext_dir, exist_ok=True) @@ -577,7 +587,6 @@ def main(): write_utf8_bom(rights_path, rights_xml) # --- 7. Register in Configuration.xml --- - config_dir = os.path.dirname(out_dir) config_xml_path = os.path.join(config_dir, 'Configuration.xml') reg_result = None diff --git a/tests/skills/cases/role-compile/basic-role.json b/tests/skills/cases/role-compile/basic-role.json index 54ee3e0b..4104ed73 100644 --- a/tests/skills/cases/role-compile/basic-role.json +++ b/tests/skills/cases/role-compile/basic-role.json @@ -3,8 +3,14 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Товары" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Товары" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -14,6 +20,9 @@ ] }, "expect": { - "files": ["Кладовщик.xml", "Кладовщик/Ext/Rights.xml"] + "files": [ + "Roles/Кладовщик.xml", + "Roles/Кладовщик/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/edit-preset.json b/tests/skills/cases/role-compile/edit-preset.json index 0d6cedee..f4a4c106 100644 --- a/tests/skills/cases/role-compile/edit-preset.json +++ b/tests/skills/cases/role-compile/edit-preset.json @@ -3,8 +3,14 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Document", "name": "РеализацияТоваров" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Document", + "name": "РеализацияТоваров" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -15,6 +21,9 @@ ] }, "expect": { - "files": ["РедакторДокументов.xml", "РедакторДокументов/Ext/Rights.xml"] + "files": [ + "Roles/РедакторДокументов.xml", + "Roles/РедакторДокументов/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/explicit-rights.json b/tests/skills/cases/role-compile/explicit-rights.json index a39c14bf..d1d782cb 100644 --- a/tests/skills/cases/role-compile/explicit-rights.json +++ b/tests/skills/cases/role-compile/explicit-rights.json @@ -3,8 +3,14 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "InformationRegister", "name": "Цены" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "InformationRegister", + "name": "Цены" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -15,6 +21,9 @@ ] }, "expect": { - "files": ["ПравоЦен.xml", "ПравоЦен/Ext/Rights.xml"] + "files": [ + "Roles/ПравоЦен.xml", + "Roles/ПравоЦен/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/minimal.json b/tests/skills/cases/role-compile/minimal.json index 27195048..090106db 100644 --- a/tests/skills/cases/role-compile/minimal.json +++ b/tests/skills/cases/role-compile/minimal.json @@ -4,6 +4,9 @@ "name": "Пустая" }, "expect": { - "files": ["Пустая.xml", "Пустая/Ext/Rights.xml"] + "files": [ + "Roles/Пустая.xml", + "Roles/Пустая/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/russian-types.json b/tests/skills/cases/role-compile/russian-types.json index def298c6..cbf4823c 100644 --- a/tests/skills/cases/role-compile/russian-types.json +++ b/tests/skills/cases/role-compile/russian-types.json @@ -3,8 +3,14 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Контрагенты" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Контрагенты" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -15,6 +21,9 @@ ] }, "expect": { - "files": ["ЧтениеКонтрагентов.xml", "ЧтениеКонтрагентов/Ext/Rights.xml"] + "files": [ + "Roles/ЧтениеКонтрагентов.xml", + "Roles/ЧтениеКонтрагентов/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/snapshots/basic-role/Configuration.xml b/tests/skills/cases/role-compile/snapshots/basic-role/Configuration.xml index ab2a9dc4..1574fe96 100644 --- a/tests/skills/cases/role-compile/snapshots/basic-role/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/basic-role/Configuration.xml @@ -247,6 +247,7 @@ Русский Товары + Кладовщик \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/basic-role/Кладовщик.xml b/tests/skills/cases/role-compile/snapshots/basic-role/Roles/Кладовщик.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/basic-role/Кладовщик.xml rename to tests/skills/cases/role-compile/snapshots/basic-role/Roles/Кладовщик.xml diff --git a/tests/skills/cases/role-compile/snapshots/basic-role/Кладовщик/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/basic-role/Roles/Кладовщик/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/basic-role/Кладовщик/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/basic-role/Roles/Кладовщик/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/edit-preset/Configuration.xml b/tests/skills/cases/role-compile/snapshots/edit-preset/Configuration.xml index 6f5d1ea2..e1556e25 100644 --- a/tests/skills/cases/role-compile/snapshots/edit-preset/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/edit-preset/Configuration.xml @@ -247,6 +247,7 @@ Русский РеализацияТоваров + РедакторДокументов \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/edit-preset/РедакторДокументов.xml b/tests/skills/cases/role-compile/snapshots/edit-preset/Roles/РедакторДокументов.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/edit-preset/РедакторДокументов.xml rename to tests/skills/cases/role-compile/snapshots/edit-preset/Roles/РедакторДокументов.xml diff --git a/tests/skills/cases/role-compile/snapshots/edit-preset/РедакторДокументов/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/edit-preset/Roles/РедакторДокументов/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/edit-preset/РедакторДокументов/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/edit-preset/Roles/РедакторДокументов/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/explicit-rights/Configuration.xml b/tests/skills/cases/role-compile/snapshots/explicit-rights/Configuration.xml index 720938cb..9cb33e1d 100644 --- a/tests/skills/cases/role-compile/snapshots/explicit-rights/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/explicit-rights/Configuration.xml @@ -247,6 +247,7 @@ Русский Цены + ПравоЦен \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/explicit-rights/ПравоЦен.xml b/tests/skills/cases/role-compile/snapshots/explicit-rights/Roles/ПравоЦен.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/explicit-rights/ПравоЦен.xml rename to tests/skills/cases/role-compile/snapshots/explicit-rights/Roles/ПравоЦен.xml diff --git a/tests/skills/cases/role-compile/snapshots/explicit-rights/ПравоЦен/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/explicit-rights/Roles/ПравоЦен/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/explicit-rights/ПравоЦен/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/explicit-rights/Roles/ПравоЦен/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/minimal/Configuration.xml b/tests/skills/cases/role-compile/snapshots/minimal/Configuration.xml index 3435599c..3961145a 100644 --- a/tests/skills/cases/role-compile/snapshots/minimal/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/minimal/Configuration.xml @@ -1,4 +1,4 @@ - + @@ -39,40 +39,40 @@ TestConfig - - + + Version8_3_24 ManagedApplication PlatformApplication Russian - + - + false false false - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + Biometrics @@ -223,18 +223,18 @@ false - - - + + + Normal - - + + Language.Русский - - - - - + + + + + Managed NotAutoFree DontUse @@ -242,10 +242,11 @@ Taxi DontUse Version8_3_24 - + Русский + Пустая \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/minimal/Пустая.xml b/tests/skills/cases/role-compile/snapshots/minimal/Roles/Пустая.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/minimal/Пустая.xml rename to tests/skills/cases/role-compile/snapshots/minimal/Roles/Пустая.xml diff --git a/tests/skills/cases/role-compile/snapshots/minimal/Пустая/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/minimal/Roles/Пустая/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/minimal/Пустая/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/minimal/Roles/Пустая/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/russian-types/Configuration.xml b/tests/skills/cases/role-compile/snapshots/russian-types/Configuration.xml index c9614252..6223a941 100644 --- a/tests/skills/cases/role-compile/snapshots/russian-types/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/russian-types/Configuration.xml @@ -247,6 +247,7 @@ Русский Контрагенты + ЧтениеКонтрагентов \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/russian-types/ЧтениеКонтрагентов.xml b/tests/skills/cases/role-compile/snapshots/russian-types/Roles/ЧтениеКонтрагентов.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/russian-types/ЧтениеКонтрагентов.xml rename to tests/skills/cases/role-compile/snapshots/russian-types/Roles/ЧтениеКонтрагентов.xml diff --git a/tests/skills/cases/role-compile/snapshots/russian-types/ЧтениеКонтрагентов/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/russian-types/Roles/ЧтениеКонтрагентов/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/russian-types/ЧтениеКонтрагентов/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/russian-types/Roles/ЧтениеКонтрагентов/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/synonym-rights/Configuration.xml b/tests/skills/cases/role-compile/snapshots/synonym-rights/Configuration.xml index ab2a9dc4..1574fe96 100644 --- a/tests/skills/cases/role-compile/snapshots/synonym-rights/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/synonym-rights/Configuration.xml @@ -247,6 +247,7 @@ Русский Товары + Кладовщик \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/synonym-rights/Кладовщик.xml b/tests/skills/cases/role-compile/snapshots/synonym-rights/Roles/Кладовщик.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/synonym-rights/Кладовщик.xml rename to tests/skills/cases/role-compile/snapshots/synonym-rights/Roles/Кладовщик.xml diff --git a/tests/skills/cases/role-compile/snapshots/synonym-rights/Кладовщик/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/synonym-rights/Roles/Кладовщик/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/synonym-rights/Кладовщик/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/synonym-rights/Roles/Кладовщик/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/view-preset/Configuration.xml b/tests/skills/cases/role-compile/snapshots/view-preset/Configuration.xml index af467a40..28562dc8 100644 --- a/tests/skills/cases/role-compile/snapshots/view-preset/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/view-preset/Configuration.xml @@ -248,6 +248,7 @@ Русский Номенклатура Загрузка + ЧтениеНоменклатуры \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/view-preset/ЧтениеНоменклатуры.xml b/tests/skills/cases/role-compile/snapshots/view-preset/Roles/ЧтениеНоменклатуры.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/view-preset/ЧтениеНоменклатуры.xml rename to tests/skills/cases/role-compile/snapshots/view-preset/Roles/ЧтениеНоменклатуры.xml diff --git a/tests/skills/cases/role-compile/snapshots/view-preset/ЧтениеНоменклатуры/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/view-preset/Roles/ЧтениеНоменклатуры/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/view-preset/ЧтениеНоменклатуры/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/view-preset/Roles/ЧтениеНоменклатуры/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/snapshots/with-rls/Configuration.xml b/tests/skills/cases/role-compile/snapshots/with-rls/Configuration.xml index 3dc93c72..2b1393e1 100644 --- a/tests/skills/cases/role-compile/snapshots/with-rls/Configuration.xml +++ b/tests/skills/cases/role-compile/snapshots/with-rls/Configuration.xml @@ -248,6 +248,7 @@ Русский Организации РеализацияТоваровУслуг + ЧтениеДокументовПоОрганизации \ No newline at end of file diff --git a/tests/skills/cases/role-compile/snapshots/with-rls/ЧтениеДокументовПоОрганизации.xml b/tests/skills/cases/role-compile/snapshots/with-rls/Roles/ЧтениеДокументовПоОрганизации.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/with-rls/ЧтениеДокументовПоОрганизации.xml rename to tests/skills/cases/role-compile/snapshots/with-rls/Roles/ЧтениеДокументовПоОрганизации.xml diff --git a/tests/skills/cases/role-compile/snapshots/with-rls/ЧтениеДокументовПоОрганизации/Ext/Rights.xml b/tests/skills/cases/role-compile/snapshots/with-rls/Roles/ЧтениеДокументовПоОрганизации/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-compile/snapshots/with-rls/ЧтениеДокументовПоОрганизации/Ext/Rights.xml rename to tests/skills/cases/role-compile/snapshots/with-rls/Roles/ЧтениеДокументовПоОрганизации/Ext/Rights.xml diff --git a/tests/skills/cases/role-compile/synonym-rights.json b/tests/skills/cases/role-compile/synonym-rights.json index bc8d5aab..8d84a891 100644 --- a/tests/skills/cases/role-compile/synonym-rights.json +++ b/tests/skills/cases/role-compile/synonym-rights.json @@ -3,8 +3,14 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Товары" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Товары" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -14,6 +20,9 @@ ] }, "expect": { - "files": ["Кладовщик.xml", "Кладовщик/Ext/Rights.xml"] + "files": [ + "Roles/Кладовщик.xml", + "Roles/Кладовщик/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/view-preset.json b/tests/skills/cases/role-compile/view-preset.json index 7f7d3dc3..d324024d 100644 --- a/tests/skills/cases/role-compile/view-preset.json +++ b/tests/skills/cases/role-compile/view-preset.json @@ -3,13 +3,25 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Номенклатура" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Номенклатура" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "DataProcessor", "name": "Загрузка" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "DataProcessor", + "name": "Загрузка" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -21,6 +33,9 @@ ] }, "expect": { - "files": ["ЧтениеНоменклатуры.xml", "ЧтениеНоменклатуры/Ext/Rights.xml"] + "files": [ + "Roles/ЧтениеНоменклатуры.xml", + "Roles/ЧтениеНоменклатуры/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-compile/with-rls.json b/tests/skills/cases/role-compile/with-rls.json index 6778cede..64784d00 100644 --- a/tests/skills/cases/role-compile/with-rls.json +++ b/tests/skills/cases/role-compile/with-rls.json @@ -3,13 +3,25 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Организации" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Организации" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Document", "name": "РеализацияТоваровУслуг" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Document", + "name": "РеализацияТоваровУслуг" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], "input": { @@ -17,13 +29,25 @@ "synonym": "Чтение документов (ограничение по организации)", "objects": [ "Catalog.Организации: @view", - { "name": "Document.РеализацияТоваровУслуг", "preset": "view", "rls": { "Read": "#ДляОбъекта(\"\")" } } + { + "name": "Document.РеализацияТоваровУслуг", + "preset": "view", + "rls": { + "Read": "#ДляОбъекта(\"\")" + } + } ], "templates": [ - { "name": "ДляОбъекта(Модификатор)", "condition": "ГДЕ Организация = &ТекущаяОрганизация" } + { + "name": "ДляОбъекта(Модификатор)", + "condition": "ГДЕ Организация = &ТекущаяОрганизация" + } ] }, "expect": { - "files": ["ЧтениеДокументовПоОрганизации.xml", "ЧтениеДокументовПоОрганизации/Ext/Rights.xml"] + "files": [ + "Roles/ЧтениеДокументовПоОрганизации.xml", + "Roles/ЧтениеДокументовПоОрганизации/Ext/Rights.xml" + ] } } diff --git a/tests/skills/cases/role-info/multiple-types.json b/tests/skills/cases/role-info/multiple-types.json index 0036c8f5..3ada5525 100644 --- a/tests/skills/cases/role-info/multiple-types.json +++ b/tests/skills/cases/role-info/multiple-types.json @@ -3,18 +3,36 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Товары" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Товары" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Document", "name": "Продажа" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Document", + "name": "Продажа" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "InformationRegister", "name": "Цены" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "InformationRegister", + "name": "Цены" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "role-compile/scripts/role-compile", @@ -26,9 +44,16 @@ "InformationRegister.Цены: Read, Update" ] }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], - "params": { "rightsPath": "Комплексная/Ext/Rights.xml" }, - "expect": { "stdoutContains": "Catalog" } + "params": { + "rightsPath": "Roles/Комплексная/Ext/Rights.xml" + }, + "expect": { + "stdoutContains": "Catalog" + } } diff --git a/tests/skills/cases/role-info/overview.json b/tests/skills/cases/role-info/overview.json index e64a3772..0f24a670 100644 --- a/tests/skills/cases/role-info/overview.json +++ b/tests/skills/cases/role-info/overview.json @@ -3,14 +3,35 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Товары" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Товары" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "role-compile/scripts/role-compile", - "input": { "name": "Тест", "rights": [{ "object": "Catalog.Товары", "rights": ["Read"] }] }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "name": "Тест", + "rights": [ + { + "object": "Catalog.Товары", + "rights": [ + "Read" + ] + } + ] + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], - "params": { "rightsPath": "Тест/Ext/Rights.xml" } + "params": { + "rightsPath": "Roles/Тест/Ext/Rights.xml" + } } diff --git a/tests/skills/cases/role-info/snapshots/multiple-types/Configuration.xml b/tests/skills/cases/role-info/snapshots/multiple-types/Configuration.xml index 68d7d77f..f8a4b65d 100644 --- a/tests/skills/cases/role-info/snapshots/multiple-types/Configuration.xml +++ b/tests/skills/cases/role-info/snapshots/multiple-types/Configuration.xml @@ -249,6 +249,7 @@ Товары Продажа Цены + Комплексная \ No newline at end of file diff --git a/tests/skills/cases/role-info/snapshots/multiple-types/Комплексная.xml b/tests/skills/cases/role-info/snapshots/multiple-types/Roles/Комплексная.xml similarity index 100% rename from tests/skills/cases/role-info/snapshots/multiple-types/Комплексная.xml rename to tests/skills/cases/role-info/snapshots/multiple-types/Roles/Комплексная.xml diff --git a/tests/skills/cases/role-info/snapshots/multiple-types/Комплексная/Ext/Rights.xml b/tests/skills/cases/role-info/snapshots/multiple-types/Roles/Комплексная/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-info/snapshots/multiple-types/Комплексная/Ext/Rights.xml rename to tests/skills/cases/role-info/snapshots/multiple-types/Roles/Комплексная/Ext/Rights.xml diff --git a/tests/skills/cases/role-info/snapshots/overview/Configuration.xml b/tests/skills/cases/role-info/snapshots/overview/Configuration.xml index ab2a9dc4..86a83015 100644 --- a/tests/skills/cases/role-info/snapshots/overview/Configuration.xml +++ b/tests/skills/cases/role-info/snapshots/overview/Configuration.xml @@ -247,6 +247,7 @@ Русский Товары + Тест \ No newline at end of file diff --git a/tests/skills/cases/role-info/snapshots/overview/Тест.xml b/tests/skills/cases/role-info/snapshots/overview/Roles/Тест.xml similarity index 100% rename from tests/skills/cases/role-info/snapshots/overview/Тест.xml rename to tests/skills/cases/role-info/snapshots/overview/Roles/Тест.xml diff --git a/tests/skills/cases/role-info/snapshots/overview/Тест/Ext/Rights.xml b/tests/skills/cases/role-info/snapshots/overview/Roles/Тест/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-info/snapshots/overview/Тест/Ext/Rights.xml rename to tests/skills/cases/role-info/snapshots/overview/Roles/Тест/Ext/Rights.xml diff --git a/tests/skills/cases/role-info/snapshots/with-rls/Configuration.xml b/tests/skills/cases/role-info/snapshots/with-rls/Configuration.xml index 122ec2d9..d3927ee0 100644 --- a/tests/skills/cases/role-info/snapshots/with-rls/Configuration.xml +++ b/tests/skills/cases/role-info/snapshots/with-rls/Configuration.xml @@ -248,6 +248,7 @@ Русский Организации Реализация + ОграниченноеЧтение \ No newline at end of file diff --git a/tests/skills/cases/role-info/snapshots/with-rls/ОграниченноеЧтение.xml b/tests/skills/cases/role-info/snapshots/with-rls/Roles/ОграниченноеЧтение.xml similarity index 100% rename from tests/skills/cases/role-info/snapshots/with-rls/ОграниченноеЧтение.xml rename to tests/skills/cases/role-info/snapshots/with-rls/Roles/ОграниченноеЧтение.xml diff --git a/tests/skills/cases/role-info/snapshots/with-rls/ОграниченноеЧтение/Ext/Rights.xml b/tests/skills/cases/role-info/snapshots/with-rls/Roles/ОграниченноеЧтение/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-info/snapshots/with-rls/ОграниченноеЧтение/Ext/Rights.xml rename to tests/skills/cases/role-info/snapshots/with-rls/Roles/ОграниченноеЧтение/Ext/Rights.xml diff --git a/tests/skills/cases/role-info/with-rls.json b/tests/skills/cases/role-info/with-rls.json index 8af2644b..200d179a 100644 --- a/tests/skills/cases/role-info/with-rls.json +++ b/tests/skills/cases/role-info/with-rls.json @@ -3,13 +3,25 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Организации" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Организации" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Document", "name": "Реализация" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Document", + "name": "Реализация" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "role-compile/scripts/role-compile", @@ -18,15 +30,31 @@ "synonym": "Ограниченное чтение", "objects": [ "Catalog.Организации: @view", - { "name": "Document.Реализация", "preset": "view", "rls": { "Read": "#ПоОрганизации(\"\")" } } + { + "name": "Document.Реализация", + "preset": "view", + "rls": { + "Read": "#ПоОрганизации(\"\")" + } + } ], "templates": [ - { "name": "ПоОрганизации(Мод)", "condition": "ГДЕ Организация = &Орг" } + { + "name": "ПоОрганизации(Мод)", + "condition": "ГДЕ Организация = &Орг" + } ] }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], - "params": { "rightsPath": "ОграниченноеЧтение/Ext/Rights.xml" }, - "expect": { "stdoutContains": "RLS" } + "params": { + "rightsPath": "Roles/ОграниченноеЧтение/Ext/Rights.xml" + }, + "expect": { + "stdoutContains": "RLS" + } } diff --git a/tests/skills/cases/role-validate/error-bad-root.json b/tests/skills/cases/role-validate/error-bad-root.json index 3db70968..1e946775 100644 --- a/tests/skills/cases/role-validate/error-bad-root.json +++ b/tests/skills/cases/role-validate/error-bad-root.json @@ -1,6 +1,8 @@ { "name": "Ошибка валидации: неверный корневой элемент роли", "setup": "fixture:bad-root", - "params": { "rightsPath": "BadRole/Ext/Rights.xml" }, + "params": { + "rightsPath": "Roles/BadRole/Ext/Rights.xml" + }, "expectError": true } diff --git a/tests/skills/cases/role-validate/multiple-objects.json b/tests/skills/cases/role-validate/multiple-objects.json index 85610977..9b878b54 100644 --- a/tests/skills/cases/role-validate/multiple-objects.json +++ b/tests/skills/cases/role-validate/multiple-objects.json @@ -3,13 +3,25 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Товары" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Товары" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Document", "name": "Заказ" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Document", + "name": "Заказ" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "role-compile/scripts/role-compile", @@ -20,8 +32,13 @@ "Document.Заказ: @edit" ] }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], - "params": { "rightsPath": "Менеджер/Ext/Rights.xml" } + "params": { + "rightsPath": "Roles/Менеджер/Ext/Rights.xml" + } } diff --git a/tests/skills/cases/role-validate/snapshots/multiple-objects/Configuration.xml b/tests/skills/cases/role-validate/snapshots/multiple-objects/Configuration.xml index 1c46b0fa..aa1a169e 100644 --- a/tests/skills/cases/role-validate/snapshots/multiple-objects/Configuration.xml +++ b/tests/skills/cases/role-validate/snapshots/multiple-objects/Configuration.xml @@ -248,6 +248,7 @@ Русский Товары Заказ + Менеджер \ No newline at end of file diff --git a/tests/skills/cases/role-validate/snapshots/multiple-objects/Менеджер.xml b/tests/skills/cases/role-validate/snapshots/multiple-objects/Roles/Менеджер.xml similarity index 100% rename from tests/skills/cases/role-validate/snapshots/multiple-objects/Менеджер.xml rename to tests/skills/cases/role-validate/snapshots/multiple-objects/Roles/Менеджер.xml diff --git a/tests/skills/cases/role-validate/snapshots/multiple-objects/Менеджер/Ext/Rights.xml b/tests/skills/cases/role-validate/snapshots/multiple-objects/Roles/Менеджер/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-validate/snapshots/multiple-objects/Менеджер/Ext/Rights.xml rename to tests/skills/cases/role-validate/snapshots/multiple-objects/Roles/Менеджер/Ext/Rights.xml diff --git a/tests/skills/cases/role-validate/snapshots/valid-role/Configuration.xml b/tests/skills/cases/role-validate/snapshots/valid-role/Configuration.xml index ab2a9dc4..86a83015 100644 --- a/tests/skills/cases/role-validate/snapshots/valid-role/Configuration.xml +++ b/tests/skills/cases/role-validate/snapshots/valid-role/Configuration.xml @@ -247,6 +247,7 @@ Русский Товары + Тест \ No newline at end of file diff --git a/tests/skills/cases/role-validate/snapshots/valid-role/Тест.xml b/tests/skills/cases/role-validate/snapshots/valid-role/Roles/Тест.xml similarity index 100% rename from tests/skills/cases/role-validate/snapshots/valid-role/Тест.xml rename to tests/skills/cases/role-validate/snapshots/valid-role/Roles/Тест.xml diff --git a/tests/skills/cases/role-validate/snapshots/valid-role/Тест/Ext/Rights.xml b/tests/skills/cases/role-validate/snapshots/valid-role/Roles/Тест/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-validate/snapshots/valid-role/Тест/Ext/Rights.xml rename to tests/skills/cases/role-validate/snapshots/valid-role/Roles/Тест/Ext/Rights.xml diff --git a/tests/skills/cases/role-validate/snapshots/with-rls/Configuration.xml b/tests/skills/cases/role-validate/snapshots/with-rls/Configuration.xml index a02d7a2c..8e57734c 100644 --- a/tests/skills/cases/role-validate/snapshots/with-rls/Configuration.xml +++ b/tests/skills/cases/role-validate/snapshots/with-rls/Configuration.xml @@ -247,6 +247,7 @@ Русский Продажа + СОграничениями \ No newline at end of file diff --git a/tests/skills/cases/role-validate/snapshots/with-rls/СОграничениями.xml b/tests/skills/cases/role-validate/snapshots/with-rls/Roles/СОграничениями.xml similarity index 100% rename from tests/skills/cases/role-validate/snapshots/with-rls/СОграничениями.xml rename to tests/skills/cases/role-validate/snapshots/with-rls/Roles/СОграничениями.xml diff --git a/tests/skills/cases/role-validate/snapshots/with-rls/СОграничениями/Ext/Rights.xml b/tests/skills/cases/role-validate/snapshots/with-rls/Roles/СОграничениями/Ext/Rights.xml similarity index 100% rename from tests/skills/cases/role-validate/snapshots/with-rls/СОграничениями/Ext/Rights.xml rename to tests/skills/cases/role-validate/snapshots/with-rls/Roles/СОграничениями/Ext/Rights.xml diff --git a/tests/skills/cases/role-validate/valid-role.json b/tests/skills/cases/role-validate/valid-role.json index 4d87f15a..163bb3b9 100644 --- a/tests/skills/cases/role-validate/valid-role.json +++ b/tests/skills/cases/role-validate/valid-role.json @@ -3,14 +3,35 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Catalog", "name": "Товары" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Catalog", + "name": "Товары" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "role-compile/scripts/role-compile", - "input": { "name": "Тест", "rights": [{ "object": "Catalog.Товары", "rights": ["Read"] }] }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "name": "Тест", + "rights": [ + { + "object": "Catalog.Товары", + "rights": [ + "Read" + ] + } + ] + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], - "params": { "rightsPath": "Тест/Ext/Rights.xml" } + "params": { + "rightsPath": "Roles/Тест/Ext/Rights.xml" + } } diff --git a/tests/skills/cases/role-validate/with-rls.json b/tests/skills/cases/role-validate/with-rls.json index ccdbd96a..305869d3 100644 --- a/tests/skills/cases/role-validate/with-rls.json +++ b/tests/skills/cases/role-validate/with-rls.json @@ -3,22 +3,42 @@ "preRun": [ { "script": "meta-compile/scripts/meta-compile", - "input": { "type": "Document", "name": "Продажа" }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "input": { + "type": "Document", + "name": "Продажа" + }, + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } }, { "script": "role-compile/scripts/role-compile", "input": { "name": "СОграничениями", "objects": [ - { "name": "Document.Продажа", "preset": "view", "rls": { "Read": "#Шаблон(\"\")" } } + { + "name": "Document.Продажа", + "preset": "view", + "rls": { + "Read": "#Шаблон(\"\")" + } + } ], "templates": [ - { "name": "Шаблон(Мод)", "condition": "ГДЕ Поле = &Параметр" } + { + "name": "Шаблон(Мод)", + "condition": "ГДЕ Поле = &Параметр" + } ] }, - "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + "args": { + "-JsonPath": "{inputFile}", + "-OutputDir": "{workDir}" + } } ], - "params": { "rightsPath": "СОграничениями/Ext/Rights.xml" } + "params": { + "rightsPath": "Roles/СОграничениями/Ext/Rights.xml" + } }