Someone asked me for this. I apologize because I would have responded to you 
directly, but I accidentally deleted your e-mail.

This is the code that I used to put the new ACEs at the top:

# Create an empty security object
my $scratch = new Win32::Perms();

# Add our rights
foreach $user (keys %{$fileinfo{$path}}) {
        $scratch->Add( $user, $fileinfo{$path}{$user}, ALLOW, DIRECTORY | 
            OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE );
}

# Read the current rights from the dir ACL 
my $dirObj = new Win32::Perms( $path );
$dirObj->Get( \@acelist );

# Add them to the end of our scratch ACL
foreach $ace (@acelist) { $scratch->Add( $ace ) }
                
# Apply the new rights
$scratch->SetDacl( $path, 0, 1 );

Hope that helps,
-Shawn

---- Original message ----
>Date: Tue, 23 Jul 2002 18:02:36 -0400
>From: "Shawn Boyle" <[EMAIL PROTECTED]>  
>Subject: RE: Add an ACE to an ACL in a specific position...  
>To: <[EMAIL PROTECTED]>
>
>The way I did this was to read in all of the ACEs, clear the ACL, and
>rebuild it in the order I wanted.
>
>I'm not sure if there's an easier way.
>
>-Shawn
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of
>[EMAIL PROTECTED]
>Sent: Tuesday, July 23, 2002 5:57 PM
>To: [EMAIL PROTECTED]
>Subject: Add an ACE to an ACL in a specific position...
>
>
>does any body know how to add an ACE to an ACL at a specific position in
>the ACL.  Right now I can add the ACE but it goes to the bottom of the ACL
>- I need it to go to the top.
>
>Thanks
>Systems Programmer
>
>Only those who have the patience to do simple things perfectly ever acquire
>the skill to do difficult things easily.
>
>Author Unknown
>
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to