SkilVaultSign inStart free

Catalogue / ziniao-erp-roles

ziniao-erp-roles

Older skill: source not recordedSignedManage Ziniao ERP roles (permission groups) with ziniao-cli: list roles and ids, inspect a role's permissions, discover available permission items, create or update roles, and assign roles to one or many staff. Use when the user mentions roles, permission groups, assigning a role to employees, check…
---
name: ziniao-erp-roles
description: "Manage Ziniao ERP roles (permission groups) with ziniao-cli: list roles and ids, inspect a role's permissions, discover available permission items, create or update roles, and assign roles to one or many staff. Use when the user mentions roles, permission groups, assigning a role to employees, checking a staff member's roles or existing permissions, or needs a role-id to create an employee — even if they do not name the CLI."
---

Ziniao ERP role management

This skill requires the ziniao-cli binary; it is unusable without it.

Core workflow

  1. Read shared setup. Before running any command, read ../ziniao-shared/SKILL.md — shared setup lives there, not here.
  1. Get role ids. Run ziniao-cli role list. Employee creation requires a --role-id, and this list is where it comes from.
  1. Discover permissions. Before creating a role, run ziniao-cli role permissions --identity-id <identity-id> to list the permission items available for that identity type, and build the role from those ids so nothing invalid is submitted.
  1. Create a role. Pass permission ids as one comma-separated string: --permission-ids "100,101". The new role's id is the response's data.id field — capture it, since assignment and employee creation need it.
  1. Update a role. role update is a full replace: omitted fields may be cleared. Run ziniao-cli role detail first, then submit the complete role — every current field plus your edits, permission ids again as a comma-separated string.
  1. Assign roles to staff. --staff-id accepts a single id or a comma-separated list for batch assignment: --staff-id "456,789,101". Query a staff member's existing roles before assigning to see what they already hold.

If an exact subcommand name is unclear, read the CLI's help output rather than guessing.

Output shaping

Append --format table for a readable listing, or --jq '<filter>' to extract only the fields a script needs — useful when chaining a role id into the next command.

Raw REST fallback

When a CLI operation is unavailable or misbehaves, call the REST API directly:

| Operation | Path | |---|---| | Role list / detail / add / edit | /superbrowser/rest/v1/erp/per/role/ | | Staff-role operations | /superbrowser/rest/v1/erp/staff/ |

Request bodies are JSON, with types differing from the CLI's flag style:

  • permissionIds is a JSON array: {"permissionIds": [100, 101]}
  • staffIds is an array of strings: {"staffIds": ["456", "789"]}

These are the same ids the CLI takes as comma-separated strings, converted to arrays. A raw add also returns the new role's id in data.id.