3 # Currently, we just confine the mob user to the mob branch here.
5 # TODO: Generalized branches push permissions support.
9 if ! [ -x /usr
/bin
/perl
]; then
10 # We are INSIDE the chroot
12 if [ -O /var
/run
/mob
]; then
13 if [ x
"$1" != x
"refs/heads/mob" ]; then
14 echo "The mob user can push only to the 'mob' branch, sorry" >&2
17 if [ x
"$2" = x
"0000000000000000000000000000000000000000" ]; then
18 echo "The mob user cannot _create_ the 'mob' branch, sorry" >&2
26 # We are NOT inside the chroot
30 if [ "$cfg_permission_control" = "Hooks" ]; then
31 # We have some permission control to do!
32 proj
="$(pwd)"; proj
="${proj#$cfg_reporoot/}"; proj
="${proj%.git}"
33 # XXX: Sanity check on project name and $USER here? Seems superfluous.
34 if ! perl
-I@basedir@
-MGirocco::Project
-le 'exit(1) unless Girocco::Project->load("'$proj'")->can_user_push("'$USER'")'; then
35 echo "The user '$USER' does not have push permissions for project '$proj'" >&2
36 echo "You can adjust push permissions at $cfg_webadmurl/editproj.cgi?name=$proj" >&2