exp:expuserroles
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).
Script bin/php/expuserroles.php, code in kernel/private/classes/commands/expuserroles.php. Run it from the installation root, as the user the web server runs as:
./console exp:expuserroles --help
./console exp:user:roles --help
php bin/php/expuserroles.php --helpHelp text
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 --applyOptions
| Option | Value | Help |
|---|---|---|
--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) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [action][role][target].
Related
Generated by ./console exp:help:examples from bin/php/expuserroles.php, kernel/private/classes/commands/expuserroles.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.