/selise-blocks:blocks-iam-usersfrom selise-blocks
Manages other users' IAM records via blocksClient.iam.users.* SDK or blocks iam users * CLI. Covers reads (get, list, emailAvailable, exists) and admin mutations (create, update, activate, deactivate, updateAccess, revokeAccess). Not for the current user's own profile.
Ships in selise-blocks. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When invoking a project-scoped blocks command, either use the resolved account's saved selection or pass --project <tenantId> for that one command without changing saved state. --project applies to CLI commands only, never SDK calls.
This skill is about an admin managing other people's IAM accounts from inside a Blocks app — inviting them, editing their profile, changing their access, deactivating them. It is not about the signed-in user managing their own account (that's the blocks-iam-account skill) and not about defining the roles/permissions being assigned (that's blocks-iam-access-control).
Everything here goes through the SDK: blocksClient.iam.users.* on the app's single @seliseblocks/client instance (created once, typically at src/lib/blocks/client.ts by blocks new web). Never raw fetch/curl against api.seliseblocks.com.
import { blocksClient } from "../../lib/blocks/client";
const { data } = await blocksClient.iam.users.get(userId);
blocks iam users *)For CLI work, resolve unknown account/project state through blocks-bootstrap before using this skill. Never select an account or tenant as a side effect of user administration.
There are two legitimate ways to drive full user administration (create, update, deactivate, activate, access grant/revoke) — both are covered by this skill:
blocksClient.iam.users.* — build the capability as a feature inside a signed-in admin's own app: the admin is looking at a screen, clicking "Deactivate" on a specific user row, and their own IAM permissions gate whether the call succeeds.blocks iam users * / blocks iam email available — the same operations, invoked directly from a terminal or an agent's shell tool. These are fully wired, project-scoped commands (see "CLI surface" below), not a read-only stub — iam me is a separate, account-scoped command for the CLI operator's own identity and is not the only IAM command the CLI has.What is not legitimate on either surface: an agent deciding on its own, without the human explicitly directing that specific action in the moment, to call create/update/deactivate/activate/updateAccess/revokeAccess (SDK) or users create/update/activate/deactivate/access grant/access revoke (CLI). State the exact change in plain language and get the user's explicit go-ahead first, every time, even if they asked for something adjacent a moment ago. The CLI enforces this mechanically — every mutating command requires --dry-run (preview only, no call) or --yes/an interactive "yes" before it executes — but that built-in gate doesn't replace stating the change and getting a real go-ahead when an agent is the one typing the command.
These don't change anything, so there's no caveat to apply:
| Method | What it does |
|---|---|
iam.users.get(id, { organizationId? }) | One user record, optionally scoped to an org. |
iam.users.list(request) | Paged/filtered user query. This is a POST-read contract — list sends { pageNo, pageSize, filter, search, ... } as a POST body, it is not a GET. |
iam.users.emailAvailable(query) | Duplicate-email check for invite forms. Needs a signed-in user with blocks-iam::iam::email-available; not callable before sign-in. |
iam.users.exists(email) | Existence check by email. Needs blocks-iam::iam::users. |
const page = await blocksClient.iam.users.list({ pageNo: 1, pageSize: 20, search: "jane" });
const check = await blocksClient.iam.users.emailAvailable({ email: "[email protected]" });
Every method below mutates a real account. Before calling any of them, restate to the user in plain language exactly what will change (which user, which field, which effect) and wait for an explicit yes — do not infer consent from an earlier, more general request.
| Method | What it does |
|---|---|
iam.users.create(request) | Invites/provisions a user in the active tenant/organization. |
iam.users.update(id, request) | Edits an IAM profile's fields. Sparse patch: an omitted or null field keeps the stored value, ""/[] clears it. Roles, permissions and MFA state are ignored by this endpoint (the server only logs a warning) -- change access with updateAccess and MFA through the MFA methods. |
iam.users.deactivate(request) | Removes access without deleting the record. |
iam.users.activate({ userId, reason }) | Restores access for a previously deactivated account. reason is required — IAM answers 400 without it (deactivate needs only userId). |
iam.users.updateAccess(request) | Grants or changes roles/permissions/org access for a user. |
iam.users.revokeAccess(request) | Removes roles/permissions/org access from a user. |
Example — deactivating a user:
Agent: "This will deactivate [email protected] (user id
usr_8a2f) — she'll immediately lose access but her record and history stay intact. Confirm?" User: "Yes, deactivate her." (only then)await blocksClient.iam.users.deactivate({ userId: "usr_8a2f" });
Never chain a mutation straight off a read (e.g. don't look a user up and deactivate them in the same breath just because the user asked to "find inactive-looking accounts") — surface what you found, then get a decision on each mutation separately.
// After the user explicitly confirms creating this exact invite:
await blocksClient.iam.users.create({
email: "[email protected]",
firstName: "New",
lastName: "Hire",
roles: ["member"]
});
// After the user explicitly confirms this exact access change:
await blocksClient.iam.users.updateAccess({ userId: "usr_8a2f", roles: ["editor"] });
blocks iam users *, blocks iam email availableThese are real, fully-wired commands — not a stub and not limited to iam me. iam me reads the current CLI operator and prefers project auth when a project resolves, falling back to account auth otherwise; every command below is strictly project-scoped and requires an impersonated project token.
Reads — no confirmation needed:
| Command | What it does |
|---|---|
blocks iam users list [--page 1] [--page-size 20] [--email <e>] [--name <n>] [--organization-id <id>[,<id>]] [--sort-by <field>] [--sort-desc] [--body '<json>'] [--json] | Paged/filtered user query. --organization-id returns only members of those organizations. There is no --filter flag: for any filter beyond the convenience flags, pass --body '{"filter":{...}}' (fields: status: {active, inactive}, accountStates, roles, userIds, organizationIds) — the convenience flags are merged over it. |
blocks iam users get <id> [--organization-id <id>] [--json] | One user record, optionally scoped to an org. |
blocks iam users exists <email> [--json] | Existence check by email in the selected project: { userId, organizationIds }, userId null when absent. |
blocks iam email available <email> [--json] | Duplicate-email check for the selected project: isAvailable: true means users create will accept the address. Agrees with users exists. Your account's role in the root project needs blocks-iam::iam::email-available; without it the command stops with permission_required. |
Mutations — every one supports --dry-run (print the request body and exit, no call) and requires either --yes or a typed yes at an interactive prompt before it executes:
| Command | What it does |
|---|---|
blocks iam users create --email <e>|--user-name <n> [--first-name] [--last-name] [--password] [--phone-number] [--organization-id] [--roles a,b] [--permissions a,b] [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json] | Invites/provisions a user. |
blocks iam users update <id> [--first-name] [--last-name] [--phone-number] [--organization-id] [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json] | Edits an IAM profile's fields. The endpoint is a sparse patch: omitted fields are kept, "" via --body clears one. --roles/--permissions/MFA fields are rejected here (the endpoint ignores them) -- use access grant and the MFA commands. |
blocks iam users activate <userId> --reason <text> [--dry-run] [--yes] [--json] | Restores access for a previously deactivated account. --reason is required (IAM records it); without it the command stops with reason_required. deactivate takes no reason. |
blocks iam users deactivate <userId> [--dry-run] [--yes] [--json] | Removes access without deleting the record. |
blocks iam users access grant <userId> [--roles a,b] [--permissions a,b] [--organization-id] [--dry-run] [--yes] [--json] | Grants roles/permissions/org access (requires at least one of --roles/--permissions). A non-empty list replaces that organization's current list; an omitted one is kept. The dry-run prints current -- pass the complete set the user should end up with. |
blocks iam users access revoke <userId> [--organization-id] [--dry-run] [--yes] [--json] | Revokes org access for a user. |
Command segments joined by a space also accept a colon
(iam:users:access:grant etc.); both forms resolve to the same handler. Use
blocks help iam users --json for the family and blocks help iam users <command> --json
for one command's flags, rather than adding --help to a subcommand, which may
run normal command logic.
Example — deactivating a user from the CLI, dry-run first:
blocks iam users deactivate usr_8a2f --dry-run # preview the request body, no call made
blocks iam users deactivate usr_8a2f --yes # after the user explicitly confirms
Apply the same confirm-before-mutating discipline here as with the SDK: state which user and which effect, wait for an explicit yes, don't chain a mutating command straight off a list/get just because the user asked to "find" something.
list is a POST, not a GET — don't assume query-string filtering.clouduser-held permissions are fully assignable to any role), not a reason to hand the user a broader role.organizationId matters in multi-org projects — pass it to get when you need a user's record in a specific org context.Record<string, unknown> (BlocksUser, BlocksBaseResponse, etc. only guarantee a few common fields) — treat fields defensively and confirm shape against a live response for the project rather than assuming a fixed schema.blocks iam users */blocks iam email available need a selected project and an impersonated project token. iam me is different only because it can fall back to account auth when no project resolves.blocks iam users deactivate usr_8a2f, --dry-run first, then --yes after explicit confirmationWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
iam, user-management, blocks, admin, cli
npx claudepluginhub selisedigitalplatforms/blocks-skills --plugin selise-blocks25 skills in this plugin
/blocksStart here for any SELISE Blocks work. Routes a plain-language request — sign-in and projects, SSO, users, roles, MFA, data schemas and records, file storage, translations, mail, notifications, workflows, functions, proxies, secrets, deployments — to the right Blocks skill, and carries the rules every Blocks skill follows: the blocks CLI and @seliseblocks/client SDK only, never raw HTTP to the platform API; --dry-run before --yes; never read the CLI's credential files; when to report a finding. Use whenever work touches SELISE Blocks, the blocks CLI, or @seliseblocks/client./blocks-bootstrapGet a user from any starting state to a working SELISE Blocks setup — CLI installed, logged in, project selected — using the `blocks` CLI, never raw fetch/curl. Detects state from `blocks auth status --json` and `blocks doctor --json`, then routes to a flow: select or create a project, inventory a project that already exists, resolve the app's OIDC client, add a social identity provider, create the first end user, scaffold a new web app, or wire an existing one. Use for a new user, for `not_logged_in`/`project_not_selected`, or whenever login/project/app state is unclear./blocks-captchaConfigure the login captcha of a SELISE Blocks project through the blocks CLI ('captcha list/get/save/enable/disable/delete'): register a reCAPTCHA or hCaptcha site key and secret, switch it on or off, see which configuration blocks-iam actually enforces at login, and retire one. CLI-only, project-scoped; the captcha secret is stored server-side and never shown. Use for 'enable captcha on login', 'change the recaptcha keys', 'why is captcha not showing', 'turn captcha off'./blocks-data-gateway-configurationConfigure a SELISE Blocks project's data model via the blocks CLI — never raw fetch/curl against api.seliseblocks.com. Covers data-source config (data config get/create/update), schema authoring and push (data schema list/pull/push, plus granular get/fields/info/indexes commands), data-access policies (data rules pull/deploy/policy), field-level validation rules (data validation *), and reloading so changes go live (data reload, or the composed data sync). Use for defining, editing, securing, validating, or reloading a project's DATA MODEL — schema fields, access policies, and validation rules./blocks-data-gateway-crudImplement create/read/update/delete against a SELISE Blocks project's runtime Data Gateway using the @seliseblocks/client SDK. Use data.collection(schemaName) for straightforward per-item CRUD, data.graphql() for joins or custom query shapes, and data.schemas.*/data.validations.* for schema/validation metadata. Shows how to wire CRUD into the React 18 + Vite + TanStack Query app that blocks new web scaffolds. Use whenever the user wants to read or write actual records through a Blocks Data schema from app code./blocks-data-storageBuild file and document-management features on SELISE Blocks Data: upload/download, directory trees, cursor-paginated browsing and search, file versions, rename/move/copy, soft delete/trash/restore, sharing, access policies, and inheritance. Use for attachments, file browsers, folders, shared files, permissions, or version history. Use 'blocks data files *' for terminal/admin work and @seliseblocks/client data.files/data.directories/data.objects for app code.Other plugins' skills for the same job