Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

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).

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/expuserroles.md

On this page

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 --help

Help 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 --apply

Options

OptionValueHelp
--subtreerequiredroles assign and unassign: the assignment limited to the subtree of this node (node id)
--sectionrequiredroles assign and unassign: the assignment limited to this section (id or identifier)
--applyMake the change; without it the command only lists what it would change (a dry run)
--dry-runThe default, kept for scripts that pass it: list what would change, change nothing
--asrequiredAct as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it
--formatrequiredtext (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].


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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x