contextualcode/permissions-inheritance-bundle
eZ Platform扩展包,允许在旧版管理员中继承用户角色。
v1.0.3
2018-08-14 10:21 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-25 16:09:44 UTC
README
eZ Platform扩展包,允许在旧版管理员中继承用户角色。
安装
- 运行
composer require
$ composer require contextualcode/permissions-inheritance-bundle
- 在
ezpublish/EzPublishKernel.php
文件中启用此扩展包,通过在registerBundles
方法中添加以下行
public function registerBundles()
{
$bundles = array(
...
new ContextualCode\PermissionsInheritanceBundle\ContextualCodePermissionsInheritanceBundle()
);
- 创建新的自定义数据库表
$ cat vendor/contextualcode/permissions-inheritance-bundle/src/ContextualCode/PermissionsInheritanceBundle/ezpublish_legacy/cc_permissions_inheritance/sql/mysql/schema.sql | mysql -u <username -p<password> <database_name>
- 安装旧版扩展
$ php ezpublish/console ezpublish:legacybundles:install_extensions --relative
- 重新生成eZ Publish旧版自动加载
$ php ezpublish/console ezpublish:legacy:script bin/php/ezpgenerateautoloads.php
- 完成。
用法
- 只需在旧版管理员中打开角色查看页面。将会有新的功能来继承角色。
- 需要执行额外的代码来将继承的角色分配给用户。您可以使用自定义登录处理器/事件监听器或任何其他方式来调用此代码
ccRoleInheritance::handleUserInheritedRoles(<user_id>);