我正在尝试在ZF2中使用bjy-authorize、zfcUser和zfc-user- trying orm。我安装了与手册相关的所有模块。要将bjyAuthorize与一起使用,我使用了本教程的https://github.com/bjyoungblood/BjyAuthorize/pull/62
如何创建新角色以及如何将其链接到用户?
上面的教程使用这个来配置role_providers:
'BjyAuthorize\Provider\Role\DoctrineEntity' => array(
'role_entity_class' => 'Material\Entity\Role',
),在BjyAuthorize的其他一些配置文件中,这是通过
// this will load roles from the user_role table in a database
// format: user_role(role_id(varchar), parent(varchar))
'BjyAuthorize\Provider\Role\Doctrine' => array(
'table' => 'user_role',
'role_id_field' => 'role_id',
'parent_role_field' => 'parent',
),这些配置之间有什么区别?
谢谢!
发布于 2013-02-14 04:10:32
请避免使用BjyAuthorize\Provider\Role\Doctrine,因为我很快就会弃用它。
继续使用新引入的BjyAuthorize\Provider\Identity\AuthenticationDoctrineEntity
BjyAuthorize\Provider\Role\Doctrine使用的是直接SQL查询,在使用Doctrine时并不建议这样做(主要是可移植性)。
https://stackoverflow.com/questions/14860030
复制相似问题