Switch user bundle for eZ Publish 5, eZ Platform 6
User switching for eZ Publish 5.4, eZ Platform 1.x eZ Platform 2.x., (*2)
Copyright (C) 2016-2018 Bamboo Data Ltd, (*3)
Licensed under GNU General Public License 2.0, (*4)
Requires eZ Publish 5.4 or above., (*5)
Install using composer:, (*6)
composer require bamboo/switch-user-bundle
Edit app/EzPublishKernel.php
or ezpublish/EzPublishKernel.php
and add the following
to the list of bundles in registerBundles()
:, (*7)
new Bamboo\SwitchUserBundle\BambooSwitchUserBundle(),
Edit app/config/routing.php
or ezpublish/config/routing.php
and add the following:, (*8)
bamboo_switch_user: resource: "@BambooSwitchUserBundle/Resources/config/routing.yml"
By default, switching is allowed to any user not in the 'Administrator users' user group.
To change this configuration, add a block to app/config/config.yml
or ezpublish/config/config.yml
.
For example:, (*9)
bamboo_switch_user: groups: deny: [] allow: [ 128 ]
This will only allow switching to users in user group with ID 128., (*10)
Decide which roles will have the ability to switch user account and in the admin
interface add the switchuser/manage
policy to them. If only the
'Administrator users' user group needs the ability then you can skip this step., (*11)
Users with this policy will be able to switch to any permitted user using the path:, (*12)
/switch-user/{username}
where {username}
is the user's login or:, (*13)
/switch-user/id/{id}
where {id}
is the ID of the user., (*14)