"sudo" adc

The sudo adc should make life easier for any admin wishing to run an adc
as some other user.

As a result, the rmrepo adc also goes back to its simple roots.  Now you
just run it via the sudo adc if you (as gitolite admin) needs to rmrepo
some user's repo.
This commit is contained in:
Sitaram Chamarty 2010-10-06 20:32:48 +05:30
parent c40622b302
commit afbab1dd8d
2 changed files with 23 additions and 11 deletions

View file

@ -6,19 +6,8 @@ delete=$1
get_rights_and_owner $delete
# please choose one alternative and delete the other para
# alternative 1 -- only creator can delete
[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!"
# alternative 2 -- creator or anyone with W access to admin repo can delete
[ "$owner" = "$GL_USER" ] || {
# but only if it is wild
[ "$owner" = "<gitolite>" ] && die "$delete is not a wild repo"
get_rights_and_owner gitolite-admin
[ -z "$perm_write" ] && die "$delete is not yours to delete and you're not the admin"
}
cd $GL_REPO_BASE_ABS
rm -rf $delete.git