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

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

Download as PDF

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

On this page

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

Help 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=Visitors

Options

OptionValueHelp
--applyWrite the changes (the default is a dry run that lists them and changes nothing)
--dry-runThe default, kept for scripts that pass it: list what would be added, change nothing
--rolerequiredThe role to complete (ID or name); default Anonymous
--onlyrequiredOnly this policy (module/function), may be repeated
--skiprequiredNever 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 ...).


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.

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