Atomically replace all permissions directly assigned to a role. An empty permissions array removes every permission from the role. Permissions that don't exist are created when the caller has permission to create them.
Required permissions:
rbac.*.add_permission_to_rolerbac.*.remove_permission_from_role
Creating a missing permission also requires rbac.*.create_permission.
Usage#
Flags#
The ID or slug of the role whose directly assigned permissions will be replaced.
The complete set of permission slugs to assign directly to the role. Separate multiple values with commas. Missing permissions are created when authorized. Pass an empty value to clear all direct permissions.
Global Flags#
| Flag | Type | Description |
|---|---|---|
--root-key | string | Override root key ($UNKEY_ROOT_KEY) |
--api-url | string | Override API base URL (default: https://api.unkey.com) |
--config | string | Path to config file (default: ~/.unkey/config.toml) |
--output | string | Output format. Use json for raw JSON |
--body | string | Send this JSON string as the request body. You cannot combine it with request-building flags. |
Examples#
Note
See Roles and permissions for RBAC concepts and examples.