Пример #1
0
 private function updatePersonalWorkspaceResourceRightsConfig(ObjectManager $manager)
 {
     $roleUser = $manager->getRepository('ClarolineCoreBundle:Role')->findOneByName('ROLE_USER');
     $config = new PwsRightsManagementAccess();
     $config->setRole($roleUser);
     $config->setIsAccessible(true);
     $manager->persist($config);
     $manager->flush();
 }
Пример #2
0
 private function updatePersonalWorkspaceResourceRightsConfig()
 {
     $em = $this->container->get('doctrine.orm.entity_manager');
     $roleUser = $this->container->get('claroline.manager.role_manager')->getRoleByName('ROLE_USER');
     //test if it exists first
     $config = $em->getRepository('ClarolineCoreBundle:Resource\\PwsRightsManagementAccess')->findOneByRole($roleUser);
     if ($config === null) {
         $this->log('Adding new personal workspace resource rights config access...');
         $config = new PwsRightsManagementAccess();
         $config->setRole($roleUser);
         $config->setIsAccessible(true);
         $em->persist($config);
         $em->flush();
     }
 }
Пример #3
0
 public function getPwsRightsManagementAccess(Role $role)
 {
     $access = $this->pwsRightsManagementAccessRepo->findOneByRole($role);
     if ($access === null) {
         $access = new PwsRightsManagementAccess();
         $access->setRole($role);
         $access->setIsAccessible(false);
         $this->om->persist($access);
         $this->om->flush();
     }
     return $access;
 }