SuperAPI AI Directory

role-validate

Coding & development

View repository

Updated 10-15 17:18

About this skill

/role-validate — 1C role validation

Checks the correctness of Rights.xml role: XML format, namespace, global flags, object types, right names, RLS restrictions, templates. Optionally checks role metadata (UUID, name, synonym).

Usage

/role-validate <RightsPath> [MetadataPath]

Running the script

powershell.exe -NoProfile -File .claude/skills/role-validate/scripts/role-validate.ps1 -RightsPath <path> [-MetadataPath <path>] [-OutFile <output.txt>]

Parameters

Parameter Required Description
-RightsPath yes Path to Rights.xml role
-MetadataPath no Path to role metadata (Roles/ИмяРоли.xml)
-OutFile no Write the result to a file (UTF-8 BOM). Without this — output to the console

Important: For Cyrillic paths use -OutFile and read the result via the Read tool.

Checks

Rights.xml

  1. XML well-formed — parses without errors
  2. Root element <Rights> с namespace http://v8.1c.ru/8.2/roles
  3. Three global flags: setForNewObjects, setForAttributesByDefault, independentRightsOfChildObjects
  4. For each <object>:
    • <name> is not empty
    • Object type recognized (Catalog, Document, InformationRegister, etc.)
    • Each <right> has <name> и <value> (true/false)
    • Right name is valid for the given object type (with a hint on a typo)
  5. Nested objects (3+ segments via .): only View, Edit (or Use for IntegrationServiceChannel) are allowed
  6. RLS <restrictionByCondition>: <condition> is not empty
  7. Templates <restrictionTemplate>: <name> и <condition> are not empty

Metadata (optional)

  • Element <Role> found
  • UUID in correct format
  • <Name> is not empty
  • <Synonym> is present

Output format

Validating: Roles/МояРоль/Ext/Rights.xml
  OK  XML well-formed
  OK  Root element: <Rights> with correct namespace
  OK  3 global flags present
  WARN  Document.Реализация: unknown right 'Rea'. Did you mean: Read?
  OK  12 objects, 45 rights
  OK  2 RLS restrictions
  OK  1 templates: ДляОбъекта

  OK  Metadata: UUID valid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
  OK  Metadata: Name = МояРоль
  OK  Metadata: Synonym present
---
Result: 0 error(s), 1 warning(s)

Message levels

Marker Value
OK Check passed
WARN Warning (unknown object type, suspicious right name)
ERR Error (invalid XML, missing required elements)

Return code: 0 — no errors, 1 — there are errors.

Examples

Rights.xml only

/role-validate upload/acc_8.3.20/Roles/БазовыеПраваБП/Ext/Rights.xml

With metadata check

/role-validate Roles/МояРоль/Ext/Rights.xml Roles/МояРоль.xml

Verification after /role-compile

/role-compile role.json Roles/
/role-validate Roles/МояРоль/Ext/Rights.xml Roles/МояРоль.xml