Catalogue / ziniao-store-permissions
ziniao-store-permissions
Older skill: source not recordedSignedBatch-grants store permissions in the ziniao superbrowser ERP to one staff member: looks up their userId, lists every store, authorizes store by store, then verifies the grants. Use when onboarding a new hire, giving an employee access to all or many stores, or batch-authorizing stores for one perso…--- name: ziniao-store-permissions description: "Batch-grants store permissions in the ziniao superbrowser ERP to one staff member: looks up their userId, lists every store, authorizes store by store, then verifies the grants. Use when onboarding a new hire, giving an employee access to all or many stores, or batch-authorizing stores for one person — even if the user just says 'give this person every store' without naming the CLI or endpoints." ---
ziniao store permissions
Grant one staff member access to many or all ziniao superbrowser ERP stores: staff lookup, store listing, per-store authorization, verification.
Read ../ziniao-shared/SKILL.md before any execution.
Requires ziniao-cli with an apiKey configured; if calls fail as unauthenticated, run ziniao-cli config init first.
Workflow
1. Find the staff member
ziniao-cli staff list --name <name> --format table
Record the userId from the matching row. If the name matches several people, ask which one is meant before any write.
2. List the stores
ziniao-cli account list --page-all
--page-all returns every store in one call — no page loop needed. Collect the storeIds, filtering to a subset if the user asked for one.
3. Authorize one store per call
The endpoint takes a staffId with a storeIdList array, but grant one store per call so a failure costs one store instead of the whole batch. The lookup in step 1 establishes the userId; the staff list output may not show a separate staffId, so confirm which value the authorize endpoint's staffId refers to (check ../ziniao-shared/SKILL.md or the staff list row) before writing. Authorization is a write: first state the plan in one line — person (name and id) and how many stores — and get the user's go-ahead once for the batch.
ziniao-cli api /superbrowser/rest/v1/erp/store/auth/add --data '{"staffId": <staffId>, "storeIdList": [<storeId>]}'Pass ids exactly as the earlier commands returned them, quoting values only if the listings show them as strings. When a call fails, log that storeId with its error and continue with the remaining stores.
4. Verify the grants
ziniao-cli api /superbrowser/rest/v1/erp/user/stores --data '{"userId": <userId>, "page": <page>, "limit": <limit>}'This endpoint expects the userId recorded in step 1, not the staffId — using the wrong id here is the standard verification failure. Increment page with limit fixed until a page returns fewer than limit results, then compare the granted storeIds against the target list. Running this check before step 3 also lets you skip stores already granted.
5. Report
Summarize the staff member, stores requested vs granted, failures with their error text, and any target store missing from the verification results so the user knows what to retry.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 2.9 kB | 83b7281fda24 |
| examples.json | 1.7 kB | 655bc05061e5 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | Not recorded | 16 Nov 2026 |
Locking a skill to one version needs Pro.