FOSUserBundle and ACL business role

This weekend I started to learn Symfony 2. I did not encounter a problem, since the structure is well documented, in my opinion.

I am using the FOSUserBundle package for ACLs. I am wondering if one can make it look like a Yii structure:

$bizRule='return Yii::app()->user->id==$params["post"]->authID;'; $task=$auth->createTask('updateOwnPost','update a post by author himself',$bizRule); $task->addChild('updatePost'); 

You can see all the details of the above snippet.

How can I achieve something similar with Symfony 2? Is it possible?

+6
source share
1 answer

Symfony2 has Access Control List and Advanced ACL Concepts cookbook recipes for more information. The actual creation of the ACL, as shown above, is extremely verbose, and I worked on the open source ACL manager to ease the pain ... this is the β€œkind of job”; This is an early beta and needs a lot of love, so use it at your own risk.

+22
source

Source: https://habr.com/ru/post/894678/


All Articles