I'm several git repositories accessible to different users. I want to allow the users to browse all repos he or she has at least READ access to.
To achieve this I have the following gitweb config:
$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/);
};
and the test_git_access_right script:
#!/bin/sh
su - git -c "gitolite access $*"
My problem is, that the test_git_acces_right script is not executed (tested by embedding an echo). So what am I doing wrong here?
Thanks in advance for any help!