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