示例#1
0
 /**
  * Fetch the gitolite readable conf for permissions on a repository
  *
  * @return string
  */
 public function fetchConfigPermissions($project, $repository, $permission_type)
 {
     if (!isset(self::$permissions_types[$permission_type])) {
         return '';
     }
     $ugroup_literalizer = new UGroupLiteralizer();
     $repository_groups = $ugroup_literalizer->getUGroupsThatHaveGivenPermissionOnObject($project, $repository->getId(), $permission_type);
     if (count($repository_groups) == 0) {
         return '';
     }
     return self::$permissions_types[$permission_type] . ' = ' . implode(' ', $repository_groups) . PHP_EOL;
 }
 /**
  * Fetch the gitolite readable conf for permissions on a repository
  *
  * @return string
  */
 public function fetchConfigPermissions($project, $repository, $permission_type)
 {
     if (!isset(self::$permissions_types[$permission_type])) {
         return '';
     }
     $git_online_edit_conf_right = $this->getUserForOnlineEdition($repository);
     $ugroup_literalizer = new UGroupLiteralizer();
     $repository_groups = $ugroup_literalizer->getUGroupsThatHaveGivenPermissionOnObject($project, $repository->getId(), $permission_type);
     if ($git_online_edit_conf_right) {
         $repository_groups[] = $git_online_edit_conf_right;
     }
     return $this->formatPermission($permission_type, $repository_groups);
 }