exp:adduserapproval
Available since Exponential 6.0.15 (in development, not in a release yet).
Summary
Set up the approval of new accounts in a user group (default: new Editors wait for the Administrator users): the workflow event on content/publish before and the role that lets the requesters create such accounts; --mode=section sets up the optional alternative, a section Staff with the plain approval event (both a dry run unless --apply)
Usage
./console exp:adduserapproval [options] php bin/php/adduserapproval.php [options]
Help
The output of ./console help exp:adduserapproval (the script run with --help), without the standard options:
Usage: bin/php/adduserapproval.php [OPTION]...
Set up the approval of new user accounts: the workflow "Approve new editor accounts" with the event
"Approve user accounts" on content/publish before (or the event first in the workflow that trigger runs
already), and the role "Editor account requests" that lets the requesting groups create accounts in
the groups that require approval. By default an editor who creates an account in Editors waits for the
Administrator users, who get a mail with the link to the approval item. What exists is left alone, so the
script can run again. Groups are remote:<remote id>, node:<node id> or name:<top-level group name>.
Prints PASS or FAIL at the end. Without --apply nothing is written, in either mode: the script lists
what it would create and change. --dry-run is still accepted and means the same as no flag; --apply
together with --dry-run is a usage error (exit 2).
--mode=section sets up the optional alternative instead, with the plain approval event: the section
"Staff" for Administrator users and Editors, and the approval event (section Staff,
approvers and the group without approval Administrator users, new objects only) on content/publish
before. It refuses while the event "Approve user accounts" runs on that trigger: choose one of the
two, never both.
Example: php bin/php/adduserapproval.php
php bin/php/adduserapproval.php --apply
php bin/php/adduserapproval.php --apply --required=name:Partners --approvers=name:Partner\ desk --no-role
php bin/php/adduserapproval.php --mode=section (dry run)
php bin/php/adduserapproval.php --mode=section --apply
Options:
--apply Make the changes, in either mode (the default is a dry run that lists them and changes nothing)
--dry-run The default, kept for scripts that pass it: list what would be created and changed, change nothing
--mode=VALUE group (default: the event "Approve user accounts") or section (the section Staff and the plain approval event)
--staff=VALUE... --mode=section: a group whose accounts go into the section Staff (default Administrator users and Editors), may be repeated
--exempt=VALUE... --mode=section: a group whose members need no approval (default Administrator users), may be repeated
--required=VALUE... A group whose new accounts need approval (default Editors), may be repeated
--approvers=VALUE... A group whose members approve (default Administrator users), may be repeated
--requesters=VALUE... A group that may create accounts in the required groups and waits for approval (default Editors), may be repeated
--no-role Do not create or assign the requesters' role (the requesters have their policies already)
--admin-id=VALUE The user the workflow is created by (default 14)Options
| Option | Value | Description |
|---|---|---|
| --apply | - | Make the changes, in either mode (the default is a dry run that lists them and changes nothing) |
| --dry-run | - | The default, kept for scripts that pass it: list what would be created and changed, change nothing |
| --mode | required | group (default: the event "Approve user accounts") or section (the section Staff and the plain approval event) |
| --staff | required | --mode=section: a group whose accounts go into the section Staff (default Administrator users and Editors), may be repeated |
| --exempt | required | --mode=section: a group whose members need no approval (default Administrator users), may be repeated |
| --required | required | A group whose new accounts need approval (default Editors), may be repeated |
| --approvers | required | A group whose members approve (default Administrator users), may be repeated |
| --requesters | required | A group that may create accounts in the required groups and waits for approval (default Editors), may be repeated |
| --no-role | - | Do not create or assign the requesters' role (the requesters have their policies already) |
| --admin-id | required | The user the workflow is created by (default 14) |
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/adduserapproval.php, kernel/private/classes/commands/adduserapproval.php
See also
Generated example: exp:adduserapproval
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment