private function getReadUGroups(Project $project)
 {
     $user_groups = $this->user_group_factory->getAllForProject($project);
     $read_ugroups = array();
     $selected_ugroups = $this->manager->getReadAccessControl($project);
     foreach ($user_groups as $ugroup) {
         $read_ugroups[] = array('label' => $ugroup->getName(), 'value' => $ugroup->getId(), 'selected' => in_array($ugroup->getId(), $selected_ugroups));
     }
     return $read_ugroups;
 }
 private function setReadWritePermissionsFromTemplate(array $ugroup_mapping)
 {
     $template = ProjectManager::instance()->getProject($this->project->getTemplate());
     $template_read_accesses = $this->mediawiki_manager->getReadAccessControl($template);
     $template_write_accesses = $this->mediawiki_manager->getWriteAccessControl($template);
     $this->mediawiki_manager->saveReadAccessControl($this->project, $this->getUgroupsForProjectFromMapping($template_read_accesses, $ugroup_mapping));
     $this->mediawiki_manager->saveWriteAccessControl($this->project, $this->getUgroupsForProjectFromMapping($template_write_accesses, $ugroup_mapping));
 }