in reply to Perms Perms Perms

I'm not an expert on Win32, or the Win32::Perms module you're using, but something like this should work:

$userPerm is your command line argument

my $flags = $folder_ace|$subfolder_ace, ACCESS_ALL +OWED_ACE_TYPE, OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE; if($userPerm eq 'READ') { $flags |= READ; } elsif($userPerm eq 'WRITE') { $flags |= WRITE; } $perms->Add('MYDOMAIN\bloggJo', $flags);

I've kept this verbose for clarity.

Your basic problem is that 'constants' in Perl are actually calls to subroutines, which return a constant value. And as the 'READ' or 'WRITE' arguments from the command line are simply text strings, they aren't then interpreted as constants.

So you need to 'translate' the command line args into calls to the relevant perl 'constants'.

Replies are listed 'Best First'.
Re: Re: Perms Perms Perms
by blackadder (Hermit) on Sep 13, 2002 at 12:29 UTC
    Thanks very much for this.

    But my Command line arguments (i.e. @ARGV) are broken into $folder_ace and $subfolder_ace, so I am a bit confused on where do I obtain $userPerms? @ARGV is an array with two elements in it, the first is the perms type for folder level and the second element is the perms type for sub folder level.

    I appreciate it if you could clear this up for me.

    Regards
    Blackadder