exp:addanonymouspublicpolicies
Give the Anonymous role the public policies it lacks: user/register, rss/feed, tags/view, the newsletter's public views (dry run unless --apply).
Script bin/php/addanonymouspublicpolicies.php, code in kernel/private/classes/commands/addanonymouspublicpolicies.php. Run it from the installation root, as the user the web server runs as:
./console exp:addanonymouspublicpolicies --help
php bin/php/addanonymouspublicpolicies.php --helpHelp text
Give the Anonymous role the policies a visitor who is not signed in needs on a public site and
it lacks: user/register (a new installation takes it out of PolicyOmitList[]), rss/feed, and where
the module exists tags/view (eztags) and newsletter subscribe, configure, unsubscribe and archive
(cjw_newsletter). A policy the role has in any form (also limited, or module/*) is left alone, so
the script can run again. Prints PASS or FAIL at the end.
Without --apply nothing is written: the script lists what it would 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/addanonymouspublicpolicies.php
php bin/php/addanonymouspublicpolicies.php --apply
php bin/php/addanonymouspublicpolicies.php --apply --only=user/register
php bin/php/addanonymouspublicpolicies.php --apply --skip=user/register --role=VisitorsOptions
| 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 added, change nothing | |
--role | required | The role to complete (ID or name); default Anonymous |
--only | required | Only this policy (module/function), may be repeated |
--skip | required | Never this policy (module/function), may be repeated; e.g. --skip=user/register keeps registration closed |
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/addanonymouspublicpolicies.php, kernel/private/classes/commands/addanonymouspublicpolicies.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.