#!%PERL% -w


use strict;

use lib '%VHFFS_LIB_DIR%';
use Vhffs::User;
use Vhffs::Main;
use Vhffs::Services::Web;
use Vhffs::Acl;

my $princ = init Vhffs::Main;

die("Usage: $0 servername username newlevel\n") unless(@ARGV == 3);

my ($servername, $username, $level) = @ARGV;

my $user = Vhffs::User::get_by_username($princ, $username);
die("User $username not found\n") unless(defined $user);

my $httpd = Vhffs::Services::Web::get_by_servername($princ, $servername);
die("Webarea $servername not found\n") unless(defined $httpd);

Vhffs::Acl::add_acl($user, $httpd , $level, $princ);

