#!%PERL%

use strict;

use Data::Dumper;
use lib '%VHFFS_LIB_DIR%';
use Vhffs::User;
use Vhffs::Group;
use Vhffs::Main;
use Vhffs::Object;
use Vhffs::Services::Mysql;
use Vhffs::Services::Web;
use Vhffs::Acl;

my $princ = init Vhffs::Main;

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

my ($servername, $username) = @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);

print "Permission: ";
print Vhffs::Acl::get_perm( $princ,  $httpd , $user );
print "\n";
