wildrepos: implement getperms and setperms

This commit is contained in:
Sitaram Chamarty 2009-12-06 14:39:40 +05:30
parent 6214ad3ab6
commit f620044156
2 changed files with 50 additions and 2 deletions

View file

@ -123,6 +123,26 @@ sub repo_rights
return ($c, $r, $w);
}
# ----------------------------------------------------------------------------
# getperms and setperms
# ----------------------------------------------------------------------------
sub get_set_perms
{
my($repo_base_abs, $repo, $verb, $user) = @_;
my ($creater, $dummy, $dummy2) = &repo_rights($repo_base_abs, $repo, "");
die "$repo doesnt exist or is not yours\n" unless $user eq $creater;
wrap_chdir("$repo_base_abs");
wrap_chdir("$repo.git");
if ($verb eq 'getperms') {
print STDERR `cat gl-perms 2>/dev/null`;
} else {
system("cat > gl-perms");
print STDERR "New perms are:\n";
print STDERR `cat gl-perms`;
}
}
# ----------------------------------------------------------------------------
# parse the compiled acl
# ----------------------------------------------------------------------------