2013-09-24 35 views
0

有沒有什麼辦法可以使用Silex實現ACL,但是沒有Doctrine ORM?沒有ORM的Silex symfony ACL

使用實體,我們可以處理這個問題是這樣

$oidd = new Symfony\Component\Security\Acl\Domain\ObjectIdentity::fromDomainObject($message(\); 
$acl = $app['security.acl.provider']->createAcl($oidd); 

// the current user is the owner 
$sid = Symfony\Component\Security\Acl\Domain\UserSecurityIdentity::fromAccount($currentUser); 
$acl->insertObjectAce($sid, Symfony\Component\Security\Acl\Permission\MaskBuilder::MASK_OWNER); 

任何解決方案?

回答

0

您可能想看看這個示例項目。

相關的引導代碼是在這裏(與Silex的1.2爲我的作品):

自述:

這是使用Silex的Symfony ACL的演示。我已經嘗試 註釋app/bootstrap.php中的服務,但說實話,我最初反向設計了symfony全棧框架DI 配置,但沒有完全理解所做的一切,仍然不是 !

+0

鏈接的項目使用Doctrine ORM。 –