[pve-devel] r4833 - in pve-access-control/trunk: . test

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jun 23 08:33:46 CEST 2010


Author: dietmar
Date: 2010-06-23 06:33:46 +0000 (Wed, 23 Jun 2010)
New Revision: 4833

Added:
   pve-access-control/trunk/test/dump-perm.pl
Modified:
   pve-access-control/trunk/ChangeLog
Log:
add simple script to dump permissions



Modified: pve-access-control/trunk/ChangeLog
===================================================================
--- pve-access-control/trunk/ChangeLog	2010-06-23 06:22:20 UTC (rev 4832)
+++ pve-access-control/trunk/ChangeLog	2010-06-23 06:33:46 UTC (rev 4833)
@@ -1,5 +1,7 @@
 2010-06-23  Proxmox Support Team  <support at proxmox.com>
 
+	* test/dump-perm.pl: simple script to dump permissions
+
 	* test/: created new directory for test skripts
 	
 	* test/dump-users.pl: simple script to dump user table

Added: pve-access-control/trunk/test/dump-perm.pl
===================================================================
--- pve-access-control/trunk/test/dump-perm.pl	                        (rev 0)
+++ pve-access-control/trunk/test/dump-perm.pl	2010-06-23 06:33:46 UTC (rev 4833)
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+
+use strict;
+use PVE::AccessControl;
+use Data::Dumper;
+
+my $username = shift;
+my $path = shift;
+
+# example: "dump-perm.pl root /"
+
+if (!($username && $path)) {
+    print "usage: $0 <username> <path>\n";
+    exit (-1);
+}
+
+my $cfg;
+
+$cfg = PVE::AccessControl::load_user_config();
+
+my $perm = PVE::AccessControl::permission($cfg, $username, $path);
+
+print "permission for user '$username' on '$path':\n";
+print Dumper($perm) . "\n";
+
+exit (0);


Property changes on: pve-access-control/trunk/test/dump-perm.pl
___________________________________________________________________
Added: svn:executable
   + *



More information about the pve-devel mailing list