blackadder has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use Win32::Perms; my $path = 'd:/'; my $acc = 'everyone'; my $prms = new Win32::Perms($path); print "\n\nPATH '" . $prms->Path() . "'\n"; my @list; my $total=0; my $indx = $prms->Get(\@list); print "index( number of entries )= $indx\n"; foreach my $rec_ref (@list) { print "\n***********************\n"; print "Record reference: $rec_ref\n"; foreach my $role (keys %$rec_ref) { print "$role = $rec_ref->{$role}\n"; } } $prms -> Dump; while ($indx--) { print "INDEX NUMBER: $indx\n"; my $rec_ref = $list[$indx]; foreach my $role (keys %$rec_ref) { next unless ($role =~ /account/i); print "$role = $rec_ref->{$role}\n"; if ($rec_ref->{$role} =~ /$acc/i) { print "Permission for this account will be removed\n"; if ( $rec_ref->{Flag} && INHERITED_ACE ) { print "\nFound inheretance here\n"; $total += $prms ->Remove($indx); $prms -> Set( ); } else { $prms ->Remove($indx); $prms -> Set( ); } } } print "****************************\n"; } $prms -> Dump;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Inherited Permissions
by particle (Vicar) on Jun 23, 2002 at 14:04 UTC |