exp:addeditorpolicies
Give the Editor role the everyday policies it lacks: content/hide, content/restore, content/reverserelatedlist, ezmultiupload, the image editor, the own account, the UI switch, the class sets of editorpolicies.ini, no duplicates (dry run unless --apply).
Script bin/php/addeditorpolicies.php, code in kernel/private/classes/commands/addeditorpolicies.php. Run it from the installation root, as the user the web server runs as:
./console exp:addeditorpolicies --help
php bin/php/addeditorpolicies.php --helpHelp text
Give the Editor role the policies an editor needs for everyday work and it lacks: hiding and
revealing (content/hide), the trash (content/restore), the list of what uses an object
(content/reverserelatedlist), where the modules are active ezmultiupload and the image editors
(expimageeditor/edit, ezie/*), and the own account
(user/password, user/selfedit, notification/use) when no other role of the editors has it.
A policy the role, or another role of the same users or groups, has in any form (also limited, or
module/*) is left alone, so the script can run again.
First, a content/* without limitations (the base data's, which plain_site keeps) is replaced by the
content functions the site packages give editors (create, edit, read, manage_locations, diff,
versionread, versionremove, remove, translate, bookmark, pendinglist, dashboard, view_embed, hide,
restore, reverserelatedlist): it also grants emptying everybody's trash, the languages, the URL
aliases and everybody's content jobs. --keep-content-wildcard leaves it. Lists what the role still
holds that an editor role should not (WARN lines). Prints PASS or FAIL at the end.
The UI switch's language and design choice (uiswitch/language, uiswitch/design) are added where
the provider exists. Then the class sets of editorpolicies.ini (default: the media site's ng_*
classes): one content/create limited to the set's classes the role cannot create yet and its parent
classes, and one websitetoolbar/use for them. A policy the role holds twice (same module, function
and limitations) is removed once (--keep-duplicates leaves it).
Without --apply nothing is written: the script lists what it would remove and add. --dry-run is
still accepted and means the same as no flag; --apply together with --dry-run is a usage error (exit 2).
Example: php bin/php/addeditorpolicies.php
php bin/php/addeditorpolicies.php --apply
php bin/php/addeditorpolicies.php --apply --only=content/restore
php bin/php/addeditorpolicies.php --apply --skip=ezmultiupload/* --role=RedakteurOptions
| Option | Value | Help |
|---|---|---|
--apply | Write the changes (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 removed and added, change nothing | |
--role | required | The role to complete (ID or name); default Editor |
--only | required | Only this policy (module/function), may be repeated |
--skip | required | Never this policy (module/function), may be repeated; e.g. --skip=content/restore keeps the trash closed |
--keep-content-wildcard | Leave a content/* of the role as it is (not replaced by single functions) | |
--keep-duplicates | Leave a policy the role holds twice (the default removes the later one) | |
--skip-class-set | required | Never this class set of editorpolicies.ini (e.g. media_site), may be repeated |
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 ...).
Related
Generated by ./console exp:help:examples from bin/php/addeditorpolicies.php, kernel/private/classes/commands/addeditorpolicies.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.