Operazioni sui ruoli degli iscritti
3 operazioni di nome memberRole.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| memberRole.list | List the site's member roles with their labels and how many members hold each. | members.manage | none |
| memberRole.create | Add a role to the site's catalogue. | members.manage | none |
| memberRole.delete | Delete a role: every member who held it loses it, and it is taken off the requiredRoles of every draft page and article that named it (the answer counts them in stripped; memberRole.list counts them beforehand in requiredBy). | members.manage | destructive |
memberRole.list
List the site's member roles with their labels and how many members hold each. A node gated to members names roles by key. Members are not versioned: a change takes effect at once.
Esempio di input
{}Input
L’input è un record: vedi lo schema qui sotto.
{
"type": "object",
"properties": {},
"additionalProperties": false
}Output
| Field | Type | Required | Notes |
|---|---|---|---|
| roles | array of object | yes | |
| roles[].key | string | yes | At most 40 characters. |
| roles[].label | string | record of string | yes | |
| roles[].memberCount | integer | yes | At least 0. |
| roles[].requiredBy | object | yes |
I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.
Provala
yarn splash memberRole.list '{}' --dry-runmemberRole.create
Add a role to the site's catalogue. The key is unique on the site and never changes. Members are not versioned: a change takes effect at once.
Esempio di input
{
"key": "press",
"label": {
"it": "Stampa",
"en": "Press"
}
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| key | string | yes | At most 40 characters. |
| label | string | record of string | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| role | object | yes | |
| role.key | string | yes | At most 40 characters. |
| role.label | string | record of string | yes | |
| role.memberCount | integer | yes | At least 0. |
| role.requiredBy | object | yes |
I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.
Provala
yarn splash memberRole.create '{"key":"press","label":{"it":"Stampa","en":"Press"}}' --dry-runmemberRole.delete
Delete a role: every member who held it loses it, and it is taken off the requiredRoles of every draft page and article that named it (the answer counts them in stripped; memberRole.list counts them beforehand in requiredBy). A node gated to that role alone shows to no member. Undoable: the undo brings back the role, its assignments and the requiredRoles. Run it with confirmed: ["destructive"]. Members are not versioned: a change takes effect at once.
Esempio di input
{
"key": "press"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| key | string | yes | At most 40 characters. |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| success | true | yes | |
| stripped | object | yes | |
| stripped.pages | integer | yes | At least 0. |
| stripped.articles | integer | yes | At least 0. |
Vuole confirmed: ["destructive"] sul batch, che la forma della CLI per una sola operazione non imposta: mettila in un file di batch ed esegui yarn splash apply <file> --dry-run.
Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 6366a0d24141b7cf).
Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.