public function rutaAction($id)
{
$em = $this->getDoctrine()->getManager();
$ruta = $em->getRepository('BoosterBiciBundle:Ruta')->findOneById($id);
$adminSecurityHandler = $this->container->get('sonata.admin.security.handler');
$objectIdentity = ObjectIdentity::fromDomainObject($ruta);
$acl = $adminSecurityHandler->getObjectAcl($objectIdentity);
foreach ($acl->getObjectAces() as $objAce) {
if(128 === $objAce->getMask()){
$ownerUsername = $objAce->getSecurityIdentity()->getUsername();
}
}
return $this->render('BoosterBiciBundle:Default:ruta.html.twig',array(
'ruta' => $ruta,
'ownerusername' => $ownerUsername
));
}
Last active
December 9, 2016 16:58
-
-
Save redleafar/2ff36e5f30869051208075dd1f173d8d to your computer and use it in GitHub Desktop.
Get owner from ACL object
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment