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
21 if [ x
"$3" = x
"0000000000000000000000000000000000000000" ]; then
22 echo "The mob user cannot _delete_ the 'mob' branch, smch, sorry"
30 # We are NOT inside the chroot
34 if [ "$cfg_permission_control" = "Hooks" ]; then
35 # We have some permission control to do!
36 proj
="$(pwd)"; proj
="${proj#$cfg_reporoot/}"; proj
="${proj%.git}"
37 # XXX: Sanity check on project name and $USER here? Seems superfluous.
38 if ! perl
-I@basedir@
-MGirocco::Project
-le 'exit(1) unless Girocco::Project->load("'$proj'")->can_user_push("'$USER'")'; then
39 echo "The user '$USER' does not have push permissions for project '$proj'" >&2
40 echo "You can adjust push permissions at $cfg_webadmurl/editproj.cgi?name=$proj" >&2