Gitweb使用gitolite检查访问权限

我是不同的用户可以访问的几个git存储库。 我想允许用户浏览他或她至less有READ访问权限的所有回购。

要做到这一点,我有以下的gitwebconfiguration:

$projectroot = '/var/lib/gitolite/repositories/'; $site_name = "my Git Repos"; $fallback_encoding = 'utf-8'; $projects_list = '/var/lib/gitolite/projects.list'; $strict_export = 1; $export_auth_hook = sub { my $repo = shift; my $user = $ENV{GL_USER}; # gitweb passes us the full repo path; so we strip the beginning # and the end, to get the repo name as it is specified in gitolite conf return unless $repo =~ s/^\Q$projectroot\E\/?(.+)\.git$/$1/; # check for (at least) "R" permission my $ret = `/usr/local/bin/test_git_access_right $repo $user`; my $res = $ret !~ /DENIED/; return ($ret !~ /DENIED/); }; 

和test_git_access_right脚本:

 #!/bin/sh su - git -c "gitolite access $*" 

我的问题是,test_git_acces_right脚本没有执行(通过embedded回声testing)。 那么我在这里做错了什么?

提前感谢任何帮助!