Inheritance: extends Sulu\Component\Persistence\Model\AuditableInterface, extends Sulu\Component\Security\Authentication\SecurityIdentityInterface
Exemplo n.º 1
0
 public function setUp()
 {
     $this->em = $this->db('ORM')->getOm();
     $this->purgeDatabase();
     $this->aclProvider = $this->getContainer()->get('security.acl.provider');
     $this->role = new Role();
     $this->role->setName('Administrator');
     $this->role->setSystem('Sulu');
     $this->em->persist($this->role);
     $this->em->flush();
 }
Exemplo n.º 2
0
 /**
  * Sets the securityType from the given data to the role.
  *
  * @param RoleInterface $role
  * @param $securityTypeData
  *
  * @throws \Sulu\Component\Rest\Exception\EntityNotFoundException
  */
 private function setSecurityType($role, $securityTypeData)
 {
     $securityType = $this->getDoctrine()->getRepository('SuluSecurityBundle:SecurityType')->findSecurityTypeById($securityTypeData['id']);
     if (!$securityType) {
         throw new EntityNotFoundException('SuluSecurityBundle:SecurityType', $securityTypeData['id']);
     }
     $role->setSecurityType($securityType);
 }