Laravel 5.2 MultiAuth和ACL

时间:2022-10-18 20:26:15

I tryed to use the Zizaco/entrust for ACL implementation, but I don't know how to link roles and permissions with 2 accounts types (users and admins are different tables). I edited the config\entrust.php, but we have

我尝试使用Zizaco /委托进行ACL实现,但我不知道如何将角色和权限与2种帐户类型(用户和管理员是不同的表)相关联。我编辑了config \ entrust.php,但我们有

 /*
|--------------------------------------------------------------------------
| Entrust role_user Table
|--------------------------------------------------------------------------
|
| This is the role_user table used by Entrust to save assigned roles to the
| database.
|
*/
'role_user_table' => 'role_user',

relation only.

只有关系。

Could someone suggest me any solution or may be other Laravel 5.2 module?

有人可以建议我任何解决方案或可能是其他Laravel 5.2模块?

1 个解决方案

#1


0  

It seems, I've found out the solution. I tryed to use PostgreSQL with 2 different schemas (public and admin). Additionally, I use pingpong modules with different namespaces. But there is not good feature: I set 'databese.default' (default DB connection with appropriate schema) config parameter in the custom middleware script. As a final step, need to run "entrust" migrations for separated schema.

看来,我已经找到了解决方案。我尝试使用PostgreSQL 2个不同的模式(公共和管理员)。另外,我使用具有不同命名空间的乒乓模块。但是没有好的功能:我在自定义中间件脚本中设置了'databese.default'(具有适当模式的默认数据库连接)配置参数。作为最后一步,需要为分离的模式运行“委托”迁移。

#1


0  

It seems, I've found out the solution. I tryed to use PostgreSQL with 2 different schemas (public and admin). Additionally, I use pingpong modules with different namespaces. But there is not good feature: I set 'databese.default' (default DB connection with appropriate schema) config parameter in the custom middleware script. As a final step, need to run "entrust" migrations for separated schema.

看来,我已经找到了解决方案。我尝试使用PostgreSQL 2个不同的模式(公共和管理员)。另外,我使用具有不同命名空间的乒乓模块。但是没有好的功能:我在自定义中间件脚本中设置了'databese.default'(具有适当模式的默认数据库连接)配置参数。作为最后一步,需要为分离的模式运行“委托”迁移。