protected function execute(InputInterface $input, OutputInterface $output)
{
if (!$this->container->has('security.acl.provider')) {
$output->writeln('You must setup the ACL system, see the Symfony2 documentation for how to do this.');
return;
}
$provider = $this->container->get('security.acl.provider');
$oid = new ObjectIdentity('class', $this->container->get('fos_user.user_manager')->getClass());
try {
$acl = $provider->createAcl($oid);
} catch (AclAlreadyExistsException $exists) {
$output->writeln('You already installed the global ACEs.');
return;
}
// insert ACEs for the super admin
$sid = new RoleSecurityIdentity(User::ROLE_SUPERADMIN);
$acl->insertClassAce($sid, MaskBuilder::MASK_IDDQD);
$provider->updateAcl($acl);
$output->writeln('Global ACEs have been installed.');
}