feat: role-compile OutputDir accepts config root (like meta-compile)

- OutputDir now accepts config root dir — creates Roles/ subdirectory
- Back-compat: if OutputDir ends with "Roles", uses it as-is
- Configuration.xml lookup adjusted accordingly
- Updated SKILL.md, PS1, PY scripts (v1.3)
- Updated test cases and snapshots for new Roles/ path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-29 13:50:52 +03:00
parent bc6bc01047
commit 0d116863ec
60 changed files with 377 additions and 123 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
---
name: role-compile
description: Создание роли 1С из описания прав. Используй когда нужно создать новую роль с набором прав на объекты
argument-hint: <JsonPath> <RolesDir>
argument-hint: <JsonPath> <OutputDir>
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 "<json>" -OutputDir "<RolesDir>"
powershell.exe -NoProfile -File .claude/skills/role-compile/scripts/role-compile.ps1 -JsonPath "<json>" -OutputDir "<ConfigDir>"
```
`<Role>ИмяРоли</Role>` автоматически добавляется в `<ChildObjects>` файла `Configuration.xml` (ожидается в parent от `RolesDir`).
Создаёт `{OutputDir}/Roles/Имя.xml` и `{OutputDir}/Roles/Имя/Ext/Rights.xml`. Регистрирует `<Role>` в `Configuration.xml`.
## JSON DSL
@@ -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
@@ -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
@@ -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"
]
}
}
@@ -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"
]
}
}
@@ -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"
]
}
}
+4 -1
View File
@@ -4,6 +4,9 @@
"name": "Пустая"
},
"expect": {
"files": ["Пустая.xml", "Пустая/Ext/Rights.xml"]
"files": [
"Roles/Пустая.xml",
"Roles/Пустая/Ext/Rights.xml"
]
}
}
@@ -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"
]
}
}
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Catalog>Товары</Catalog>
<Role>Кладовщик</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Document>РеализацияТоваров</Document>
<Role>РедакторДокументов</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<InformationRegister>Цены</InformationRegister>
<Role>ПравоЦен</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.17">
<Configuration uuid="UUID-001">
<InternalInfo>
@@ -39,40 +39,40 @@
<v8:content>TestConfig</v8:content>
</v8:item>
</Synonym>
<Comment/>
<NamePrefix/>
<Comment />
<NamePrefix />
<ConfigurationExtensionCompatibilityMode>Version8_3_24</ConfigurationExtensionCompatibilityMode>
<DefaultRunMode>ManagedApplication</DefaultRunMode>
<UsePurposes>
<v8:Value xsi:type="app:ApplicationUsePurpose">PlatformApplication</v8:Value>
</UsePurposes>
<ScriptVariant>Russian</ScriptVariant>
<DefaultRoles/>
<DefaultRoles />
<Vendor></Vendor>
<Version></Version>
<UpdateCatalogAddress/>
<UpdateCatalogAddress />
<IncludeHelpInContents>false</IncludeHelpInContents>
<UseManagedFormInOrdinaryApplication>false</UseManagedFormInOrdinaryApplication>
<UseOrdinaryFormInManagedApplication>false</UseOrdinaryFormInManagedApplication>
<AdditionalFullTextSearchDictionaries/>
<CommonSettingsStorage/>
<ReportsUserSettingsStorage/>
<ReportsVariantsStorage/>
<FormDataSettingsStorage/>
<DynamicListsUserSettingsStorage/>
<URLExternalDataStorage/>
<Content/>
<DefaultReportForm/>
<DefaultReportVariantForm/>
<DefaultReportSettingsForm/>
<DefaultReportAppearanceTemplate/>
<DefaultDynamicListSettingsForm/>
<DefaultSearchForm/>
<DefaultDataHistoryChangeHistoryForm/>
<DefaultDataHistoryVersionDataForm/>
<DefaultDataHistoryVersionDifferencesForm/>
<DefaultCollaborationSystemUsersChoiceForm/>
<RequiredMobileApplicationPermissions/>
<AdditionalFullTextSearchDictionaries />
<CommonSettingsStorage />
<ReportsUserSettingsStorage />
<ReportsVariantsStorage />
<FormDataSettingsStorage />
<DynamicListsUserSettingsStorage />
<URLExternalDataStorage />
<Content />
<DefaultReportForm />
<DefaultReportVariantForm />
<DefaultReportSettingsForm />
<DefaultReportAppearanceTemplate />
<DefaultDynamicListSettingsForm />
<DefaultSearchForm />
<DefaultDataHistoryChangeHistoryForm />
<DefaultDataHistoryVersionDataForm />
<DefaultDataHistoryVersionDifferencesForm />
<DefaultCollaborationSystemUsersChoiceForm />
<RequiredMobileApplicationPermissions />
<UsedMobileApplicationFunctionalities>
<app:functionality>
<app:functionality>Biometrics</app:functionality>
@@ -223,18 +223,18 @@
<app:use>false</app:use>
</app:functionality>
</UsedMobileApplicationFunctionalities>
<StandaloneConfigurationRestrictionRoles/>
<MobileApplicationURLs/>
<AllowedIncomingShareRequestTypes/>
<StandaloneConfigurationRestrictionRoles />
<MobileApplicationURLs />
<AllowedIncomingShareRequestTypes />
<MainClientApplicationWindowMode>Normal</MainClientApplicationWindowMode>
<DefaultInterface/>
<DefaultStyle/>
<DefaultInterface />
<DefaultStyle />
<DefaultLanguage>Language.Русский</DefaultLanguage>
<BriefInformation/>
<DetailedInformation/>
<Copyright/>
<VendorInformationAddress/>
<ConfigurationInformationAddress/>
<BriefInformation />
<DetailedInformation />
<Copyright />
<VendorInformationAddress />
<ConfigurationInformationAddress />
<DataLockControlMode>Managed</DataLockControlMode>
<ObjectAutonumerationMode>NotAutoFree</ObjectAutonumerationMode>
<ModalityUseMode>DontUse</ModalityUseMode>
@@ -242,10 +242,11 @@
<InterfaceCompatibilityMode>Taxi</InterfaceCompatibilityMode>
<DatabaseTablespacesUseMode>DontUse</DatabaseTablespacesUseMode>
<CompatibilityMode>Version8_3_24</CompatibilityMode>
<DefaultConstantsForm/>
<DefaultConstantsForm />
</Properties>
<ChildObjects>
<Language>Русский</Language>
<Role>Пустая</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Catalog>Контрагенты</Catalog>
<Role>ЧтениеКонтрагентов</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Catalog>Товары</Catalog>
<Role>Кладовщик</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -248,6 +248,7 @@
<Language>Русский</Language>
<Catalog>Номенклатура</Catalog>
<DataProcessor>Загрузка</DataProcessor>
<Role>ЧтениеНоменклатуры</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -248,6 +248,7 @@
<Language>Русский</Language>
<Catalog>Организации</Catalog>
<Document>РеализацияТоваровУслуг</Document>
<Role>ЧтениеДокументовПоОрганизации</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -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"
]
}
}
@@ -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"
]
}
}
+31 -7
View File
@@ -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"
]
}
}
@@ -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"
}
}
+26 -5
View File
@@ -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"
}
}
@@ -249,6 +249,7 @@
<Catalog>Товары</Catalog>
<Document>Продажа</Document>
<InformationRegister>Цены</InformationRegister>
<Role>Комплексная</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Catalog>Товары</Catalog>
<Role>Тест</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -248,6 +248,7 @@
<Language>Русский</Language>
<Catalog>Организации</Catalog>
<Document>Реализация</Document>
<Role>ОграниченноеЧтение</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
+37 -9
View File
@@ -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"
}
}
@@ -1,6 +1,8 @@
{
"name": "Ошибка валидации: неверный корневой элемент роли",
"setup": "fixture:bad-root",
"params": { "rightsPath": "BadRole/Ext/Rights.xml" },
"params": {
"rightsPath": "Roles/BadRole/Ext/Rights.xml"
},
"expectError": true
}
@@ -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"
}
}
@@ -248,6 +248,7 @@
<Language>Русский</Language>
<Catalog>Товары</Catalog>
<Document>Заказ</Document>
<Role>Менеджер</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Catalog>Товары</Catalog>
<Role>Тест</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -247,6 +247,7 @@
<ChildObjects>
<Language>Русский</Language>
<Document>Продажа</Document>
<Role>СОграничениями</Role>
</ChildObjects>
</Configuration>
</MetaDataObject>
@@ -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"
}
}
+26 -6
View File
@@ -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"
}
}