コード例 #1
0
 public function __construct(RoleHierarchyInterface $roleHierarchy, $prefix = 'ROLE_')
 {
     $this->roleHierarchy = $roleHierarchy;
     parent::__construct($prefix);
 }
コード例 #2
0
ファイル: RoleVoterTest.php プロジェクト: laubosslink/lab
 /**
  * @dataProvider getVoteTests
  */
 public function testVote($roles, $attributes, $expected)
 {
     $voter = new RoleVoter();
     $this->assertSame($expected, $voter->vote($this->getToken($roles), null, $attributes));
 }
コード例 #3
0
 /**
  * @param RoleCollection $roleCollection
  * @param string         $prefix
  */
 public function __construct(RoleCollection $roleCollection, $prefix = 'ROLE_')
 {
     parent::__construct($prefix);
     $this->roleCollection = $roleCollection;
 }