竹子/switch-user-bundle

为 eZ Publish 5,eZ Platform 1,eZ Platform 2 提供用户切换功能

0.1.1 2018-09-13 20:08 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:14:37 UTC


README

License: GPL v2

摘要

eZ Publish 5.4,eZ Platform 1.x eZ Platform 2.x 的用户切换功能。

版权

版权(C)2016-2018 Bamboo Data Ltd

许可证

许可协议:GNU 通用公共许可证 2.0

要求

需要 eZ Publish 5.4 或更高版本。

安装

使用 composer 安装

composer require bamboo/switch-user-bundle

编辑 app/EzPublishKernel.phpezpublish/EzPublishKernel.php,并在 registerBundles() 的列表中添加以下内容

new Bamboo\SwitchUserBundle\BambooSwitchUserBundle(),

编辑 app/config/routing.phpezpublish/config/routing.php,并添加以下内容

bamboo_switch_user:
    resource: "@BambooSwitchUserBundle/Resources/config/routing.yml"

配置

默认情况下,允许切换不在“管理员用户”用户组的任何用户。要更改此配置,请向 app/config/config.ymlezpublish/config/config.yml 中添加一个块。例如

bamboo_switch_user:
    groups:
        deny: []
        allow: [ 128 ]

这将只允许切换到用户组 ID 为 128 的用户。

用法

决定哪些角色将具有切换用户账户的能力,并在管理界面中向它们添加 switchuser/manage 策略。如果只有“管理员用户”用户组需要此功能,则可以跳过此步骤。

具有此策略的用户将能够通过以下路径切换到任何允许的用户

/switch-user/{username}

其中 {username} 是用户的登录名或

/switch-user/id/{id}

其中 {id} 是用户的 ID。