Intranet后端与Symfony2中的前端之间的共享实体

时间:2014-02-21 13:50:32

标签: symfony

我正在使用Symfony2应用程序。我希望后端只能从内部网和公众可用的前端获得。 Doctrine实体由两者共享。

这样做的最佳方法是什么?

1 个答案:

答案 0 :(得分:0)

最好的方法是使用FOSUserBundle(https://github.com/FriendsOfSymfony/FOSUserBundle)并确定后端哪些角色已授予您后端的访问权。

例如:

frontend : no role defined
intranet : only registred user -> ROLE_USER 
backend : only registred user with admin access -> ROLE_ADMIN

因为symfony2文档谈论它所以非常容易部署

http://symfony.com/doc/current/cookbook/bundles/inheritance.html

和sf2的一个非常好的管理生成器: https://github.com/sonata-project/SonataAdminBundle

希望这会有所帮助

相关问题