Skip to the content
Documentation

exp:addeditorpolicies

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

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)

Usage

./console exp:addeditorpolicies [options]
php bin/php/addeditorpolicies.php [options]

Help

The output of ./console help exp:addeditorpolicies (the script run with --help), without the standard options:

Usage: bin/php/addeditorpolicies.php [OPTION]...
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=Redakteur


Options:
  --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=VALUE               The role to complete (ID or name); default Editor
  --only=VALUE...            Only this policy (module/function), may be repeated
  --skip=VALUE...            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=VALUE...  Never this class set of editorpolicies.ini (e.g. media_site), may be repeated

Options

Option Value Description
--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

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/addeditorpolicies.php, kernel/private/classes/commands/addeditorpolicies.php

See also

Generated example: exp:addeditorpolicies

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.