role-edit — Claude Code skill: what it does, how to install
Edits an existing 1C role in place: permissions, RLS rules, templates, and role properties. Its changes preserve the role UUID and other rights.
/plugin marketplace add Nikolay-Shirokov/cc-1c-skills
/plugin install 1c-skills@cc-1c-skillsWhat role-edit does
The skill updates an existing 1C role instead of creating a replacement. It can grant, replace, remove, or deny permissions, configure RLS restrictions, and manage access templates. Role synonyms, comments, and global flags can be changed as well, while the UUID and unrelated rights remain intact.
Use RolePath, Operation, and Value for a single change. A JSON file passed through DefinitionFile can hold several different operations. The skill runs scripts/role-edit.ps1 and can trigger role-validate after editing unless -NoValidate is used. Its declared tools are Bash, Read, Write, and Glob.
An RLS restriction must target a permission already granted to the role. Otherwise the platform ignores it and the skill rejects the edit. Invalid values also stop the write, leaving the role file unchanged.
What it helps with
- grant rights to an object while keeping existing permissions
- replace an object's permission set
- deny access to an attribute or tabular section
- configure an RLS condition or access template
- change a role synonym or comment
Example prompts for the agent
- Use
/role-editto grant read and update rights forInformationRegister.Prices. - Run
/role-editto remove delete access fromDocument.Order. - Apply several role changes from
operations.jsonwith/role-editand-DefinitionFile.
How to install role-edit
1Plugin marketplace
/plugin marketplace add Nikolay-Shirokov/cc-1c-skills/plugin install 1c-skills@cc-1c-skillsThis installs the whole 1c-skills plugin with all its skills
2Skills CLI (Vercel)
npx skills add Nikolay-Shirokov/cc-1c-skills --skill role-edit -a claude-code3Manually: put the files in place
~/.claude/skills/role-edit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/role-edit/
1Skills CLI (Vercel)
npx skills add Nikolay-Shirokov/cc-1c-skills --skill role-edit -a codex2Manually: put the files in place
.agents/skills/role-edit/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/role-edit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Nikolay-Shirokov/cc-1c-skills role-edit2Manually: put the files in place
.github/skills/role-edit/SKILL.mdPlatform CLI
gemini skills install https://github.com/Nikolay-Shirokov/cc-1c-skills --path .claude/skills/role-editManually: put the files in place
.devin/skills/role-edit/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about role-edit
How do I install role-edit in Claude Code?
Add the marketplace with /plugin marketplace add Nikolay-Shirokov/cc-1c-skills, then install the skill with /plugin install 1c-skills@cc-1c-skills.
What does role-edit do?
It edits permissions, RLS rules, templates, role properties, synonyms, and comments in an existing 1C role. The UUID and unrelated rights stay unchanged.
What happens when an RLS rule targets a missing permission?
The platform ignores the restriction, so the skill rejects the edit. Grant the permission to the role first.
Source text
SKILL.md · MIT
---
name: role-edit
description: Точечное редактирование существующей роли 1С. Используй когда нужно добавить, снять или запретить права, настроить RLS-ограничения и шаблоны, изменить свойства роли без потери прочих прав и UUID
argument-hint: <RolePath> -Operation <op> -Value "<val>" | -DefinitionFile <json> [-NoValidate]
allowed-tools:
- Bash
- Read
- Write
- Glob
---
# /role-edit — точечное редактирование роли 1С
Меняет права существующей роли на месте: UUID, прочие права, RLS и шаблоны сохраняются.
Создание новой роли — `/role-compile`.
## Параметры и команда
| Параметр | Описание |
|----------|----------|
| `RolePath` | Каталог роли, `Roles/Имя.xml` или `Roles/Имя/Ext/Rights.xml` |
| `Operation` | Одна операция из таблицы ниже |
| `Value` | Значение операции; несколько значений — через `;;` |
| `DefinitionFile` | JSON-массив операций (альтернатива `Operation`) — так задают несколько разных операций |
| `NoValidate` | Не запускать `role-validate` после правки |
```powershell
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/role-edit.ps1" -RolePath "<роль>" -Operation <op> -Value "<значение>"
```
Операции применяются в том порядке, в котором перечислены.
## Операции
| Операция | Формат `Value` | Описание |
|----------|----------------|----------|
| `add-rights` | `Тип.Имя: Право1, Право2` или `Тип.Имя: @пресет` | Добавить права, прежние сохранить |
| `set-rights` | то же | Заменить набор прав объекта целиком |
| `remove-rights` | `Тип.Имя: Право1, Право2` — снять права<br>`Тип.Имя` — удалить объект целиком | Снять права |
| `deny-rights` | `Тип.Имя: Право1, Право2` | Закрыть реквизит или ТЧ, которые иначе наследуют права объекта |
| `set-rls` | `Тип.Имя.Право: условие`<br>`Тип.Имя.Право[Поле1, Поле2]: условие` | Ограничение доступа к данным |
| `remove-rls` | `Тип.Имя.Право` — снять все<br>`Тип.Имя.Право[Поле1]` — снять одну строку | Снять ограничение, право оставить |
| `add-template` | `Имя(Параметры): условие` | Добавить шаблон ограничения |
| `set-template` | то же | Заменить шаблон, а если его нет — добавить |
| `remove-template` | `Имя(Параметры)` или `Имя` | Удалить шаблон |
| `modify-property` | `setForNewObjects=true`<br>`setForAttributesByDefault=false`<br>`independentRightsOfChildObjects=true` | Глобальные флаги роли |
| `set-synonym` | текст | Синоним роли |
| `set-comment` | текст | Комментарий роли |
## Быстрые примеры
```powershell
# Добавить права нового регистра, ничего не потеряв
... -RolePath "src/Roles/Менеджер" -Operation add-rights -Value "InformationRegister.Цены: Read, Update"
# Пресет и несколько объектов в одном вызове
... -RolePath "src/Roles/Менеджер" -Operation add-rights -Value "Catalog.Товары: @view ;; Document.Заказ: @edit"
# Снять права; объект без разрешающих прав удаляется целиком
... -RolePath "src/Roles/Менеджер" -Operation remove-rights -Value "Document.Заказ: Delete"
# Закрыть реквизит от роли
... -RolePath "src/Roles/Менеджер" -Operation deny-rights -Value "Catalog.Товары.Attribute.Цена: View"
```
Несколько разных операций — списком в файле:
```json
[
{ "operation": "add-rights", "value": "Catalog.Товары: @view" },
{ "operation": "set-rls", "value": "Catalog.Товары.Read: #ПоОрганизации(\"\")" }
]
```
```powershell
... -RolePath "src/Roles/Менеджер" -DefinitionFile "операции.json"
```
## Права
Имена объектов и прав — те же, что в `/role-compile`: `Catalog`, `Read`, пресеты `@view` и
`@edit`, вложенные пути (`Catalog.Контрагенты.Attribute.ИНН: View, Edit`), короткая запись сервиса
(`HTTPService.ЭДО: Use` раскрывается по всем методам шаблонов URL).
`remove-rights` и `deny-rights` задевают больше перечисленного: уходят и права, которым снятое
нужно (сняли `Read` — уйдут `Update`, `View`, `Edit`). Снятое каскадом перечисляется в выводе.
Ошибка в значении — отказ до записи, файл не меняется. Полные таблицы «тип → права» и виды
вложенности — в справке `/role-compile`.
## RLS
Ограничения права — это список строк, как в таблице «Ограничения доступа к данным» редактора.
Строка без списка полей действует на все прочие поля, строка со списком — только на них.
Типовой приём: закрыть данные целиком, но оставить поля представления ссылки открытыми, иначе
ссылки на объект превратятся в «объект не найден»:
```powershell
... -Operation set-rls -Value "Catalog.Товары.Read: ГДЕ ЛОЖЬ"
... -Operation set-rls -Value "Catalog.Товары.Read[Ссылка, Код, Наименование]: "
```
Строка с тем же набором полей заменяется, с другим — добавляется. Право должно быть уже выдано:
ограничение без права платформа игнорирует, поэтому навык откажет.
Ссылка на шаблон — `#ИмяШаблона("")`; `&` в условиях экранируется автоматически.
## Значение из файла
Вместо текста можно указать `@путь` — условие RLS, тело шаблона, синоним и комментарий берутся из
файла. Относительный путь ищется рядом с `DefinitionFile`, затем в текущем каталоге. Разделитель
`;;` внутри файла остаётся обычным текстом.
```powershell
... -Operation set-rls -Value "Catalog.Товары.Read: @условие.txt"
... -Operation add-template -Value "ПоОрганизации(Мод): @условие.txt"
... -Operation set-comment -Value "@комментарий.txt"
```
## Верификация
```
/role-info <RightsPath> — сводка прав после правки
/role-validate <RightsPath> — проверка корректности (запускается автоматически)
```
© Nikolay Shirokov · MIT · Nikolay-Shirokov/cc-1c-skills