exp:expuserroles
Available since Exponential 6.0.15 (in development, not in a release yet).
Summary
Role assignments: list those of a user or group, assign a role with or without a subtree or section limitation, unassign it, as role/assign does (changes are a dry run unless --apply)
Usage
./console exp:expuserroles [options] php bin/php/expuserroles.php [options] ./console exp:user:roles [options]
Aliases
exp:user:roles
Help
The output of ./console help exp:expuserroles (the script run with --help), without the standard options:
Usage: bin/php/expuserroles.php [OPTION]... [ACTION] [ROLE] [TARGET] Role assignments of users and groups list <target> shows the roles that reach a user or a group, with where each comes from (the account, the group or a group above it) and its limitation. assign <role> <target> assigns a role, limited to a subtree (--subtree=<node id>) or a section (--section=<id or identifier>) or without a limitation; unassign <role> <target> removes the role's assignments from the target (with --subtree or --section only that limited one). The role is named by id or name; the target is a user (login, e-mail or id) or group:<node id or name>. The audit records access.role.assign and access.role.unassign, and the role, policy and content caches are cleared as role/assign does. Without --apply nothing is changed. ./console exp:user:roles list jane ./console exp:user:roles list group:Editors ./console exp:user:roles assign Editor group:Partners --subtree=2 --apply ./console exp:user:roles assign "Member management" jane --section=standard --apply ./console exp:user:roles unassign Editor jane --apply Options: --subtree=VALUE roles assign and unassign: the assignment limited to the subtree of this node (node id) --section=VALUE roles assign and unassign: the assignment limited to this section (id or identifier) --apply Make the change; without it the command only lists what it would change (a dry run) --dry-run The default, kept for scripts that pass it: list what would change, change nothing --as=VALUE Act as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it --format=VALUE text (default) or json (the machine output exp-user/1)
Options
| Option | Value | Description |
|---|---|---|
| --subtree | required | roles assign and unassign: the assignment limited to the subtree of this node (node id) |
| --section | required | roles assign and unassign: the assignment limited to this section (id or identifier) |
| --apply | - | Make the change; without it the command only lists what it would change (a dry run) |
| --dry-run | - | The default, kept for scripts that pass it: list what would change, change nothing |
| --as | required | Act as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it |
| --format | required | text (default) or json (the machine output exp-user/1) |
Arguments
[action][role][target]
Standard options
Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.
Source
bin/php/expuserroles.php, kernel/private/classes/commands/expuserroles.php
See also
Generated example: exp:expuserroles
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment