Skip to content

CLI: Roles

Commands to create, change, and delete a space’s roles (sets of allowed actions). Common flags that you can add to any command (--host, --json, and others) are in the CLI command reference.

Command Description
hakocms-cli roles create Create a role
hakocms-cli roles delete Delete a role
hakocms-cli roles get Get a role
hakocms-cli roles list List roles
hakocms-cli roles update Change a role’s name and permissions

Create a role.

ターミナルウィンドウ
hakocms-cli roles create [OPTIONS]
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
--actions <JSON> Actions on entries ({"default": ["read", ...], "contentTypes": {"<ID>": [...]}}). By default, nothing is allowed on anything. Use @file to read from a file, - to read from standard input
--name <TEXT> Role name
--permissions <JSON> Permissions on the whole space (an array of strings). Empty by default. Use @file to read from a file, - to read from standard input
--data <JSON> The whole body (JSON). Use @file to read from a file, - to read from standard input. Other flags are applied on top of it

Delete a role.

ターミナルウィンドウ
hakocms-cli roles delete [OPTIONS] <ID>
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
<ID> ID
--force Do it without asking for confirmation

Get a role.

ターミナルウィンドウ
hakocms-cli roles get [OPTIONS] <ID>
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
<ID> ID

List roles.

ターミナルウィンドウ
hakocms-cli roles list [OPTIONS]
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order

Change a role’s name and permissions.

ターミナルウィンドウ
hakocms-cli roles update [OPTIONS] <ID>
Flag or argument Description
-s, --space <SLUG> Space. If omitted: HAKOCMS_SPACE, hakocms-cli.toml, then the one set with spaces use, in that order
<ID> ID
--actions <JSON> Actions on entries ({"default": ["read", ...], "contentTypes": {"<ID>": [...]}}). By default, nothing is allowed on anything. Use @file to read from a file, - to read from standard input
--name <TEXT> Role name
--permissions <JSON> Permissions on the whole space (an array of strings). Empty by default. Use @file to read from a file, - to read from standard input
--data <JSON> The whole body (JSON). Use @file to read from a file, - to read from standard input. Other flags are applied on top of it