Set a user's access (groups and/or permissions)
set_user_accessSet a user's groups and permissions by fully replacing lists, with dry-run and confirmation options.
Instructions
Replace a user's group membership and/or permission set — pass groups, permissions, or both; each provided list is a FULL REPLACE (not additive), an omitted one is untouched. Requires admin writes enabled (PORTAL_ALLOW_ADMIN_WRITES=1) and confirm:true. dry_run:true reports the current access next to the proposed lists without writing. Stripping YOUR OWN admin access is refused unless allow_self_lockout=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groups | No | Complete list of group ids the user should have (full replace). | |
| confirm | Yes | Must be true — each provided list REPLACES that entire membership. | |
| dry_run | No | Report current vs proposed access without writing. | |
| user_id | Yes | User UUID. | |
| permissions | No | Complete list of permission ids the user should have (full replace). | |
| allow_self_lockout | No | Must be true to remove your OWN admin group/permission — after that you may not be able to undo anything. |