Could someone comfortable with Win32::Perms offer some guidance?

I'm trying to set the following permissions on a set of user folders:

--Domain Admins: Full Control (folder and subfolders and files, inheritable)
--\\Server\Administrators: Full Control (folder and subfolders and files,
inheritable)
--Domain\user:
        Full Control (subfolders & files only, inheritable),
        Full minus DELETE | WRITE_DAC | WRITE_OWNER (on the folder itself, not
inheritable)

Setting the admin permissions is no trouble--it's fine-tuning the user perms
that's causing all the problems. I've been through the Roth book (1&2ed)
several times, but still can't figure out how to set the flags properly.
Here's the closest I've come (this code sets the user perms adequately, but
wipes out the admin perms on subfolders & files):

# .... admin perms already set; set user perms on folder
$PermsDir = new Win32::Perms( $userpath);
$PermsDir->Add( $userid,
        DELETE | WRITE_DAC | WRITE_OWNER,
        ACCESS_DENIED_ACE_TYPE,
        NO_PROPAGATE_INHERIT_ACE) ;
$PermsDir->Add( $userid,
        GENERIC_ALL,
        ACCESS_ALLOWED_ACE_TYPE,
        NO_PROPAGATE_INHERIT_ACE) ;
$PermsDir->Set( $userpath, 0, 0);
$PermsDir->Close();

# now set perms for subfolders, files
$PermsDir = new Win32::Perms( "$userpath\\*.*" );
$PermsDir->Add( $userid,
        GENERIC_ALL,
        ACCESS_ALLOWED_ACE_TYPE,
        OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE) ;
$PermsDir->SetRecurse( "$userpath\\*.*", $FALSE);
$PermsDir->SetRecurse( "$userpath\\*.*", $TRUE);
$PermsDir->Close();

I figure the problem has to be with the inheritance flags, but I've tried
every combination that made sense to me, with no success.  Can anyone tell
me what I'm doing wrong?  --Chris

===================
Christopher Mackie
Princeton University
[EMAIL PROTECTED]

Attachment: Blank Bkgrd.gif
Description: GIF image

BEGIN:VCARD
VERSION:2.1
N:Mackie;Christopher;J.
FN:Christopher J. Mackie
NICKNAME:Chris
ORG:Princeton University;Department of Politics
TITLE:Computer Support, Politics Department
TEL;WORK;VOICE:(609) 258-1955
TEL;WORK;VOICE:(609) 258-1955
TEL;HOME;VOICE:(609) 683-4742
TEL;WORK;FAX:(609) 258-1110
ADR;WORK:;;236 Corwin Hall;Princeton;NJ;08544;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:236 Corwin Hall=0D=0APrinceton, NJ 08544=0D=0AUnited States of America
ADR;HOME:;;150 FitzRandolph Rd.;Princeton;NJ;08540;United States of America
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:150 FitzRandolph Rd.=0D=0APrinceton, NJ 08540=0D=0AUnited States of America
X-WAB-GENDER:2
URL;WORK:http://www.princeton.edu/~cjmackie
BDAY:20011230
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
FBURL:?????????????????
REV:20011104T224552Z
END:VCARD

Reply via email to