O'Holly Ones....Greetings

I am quite confused on how can go about assigning permissions to an account.

You see, I would like to mimic the way permissions are assigned to a group or a user thought Windows NT explorer.

For example: in explorer you can go to c: drive, select the temp folder and then right click, then select properties, security tab and then select permissions. In there, the type of access can be any of the following:

No access, List, Read, Add, Add & Read, Change and full control (those are the only ones I am interested in).

Then in my script I have this line,
$perms->Add("$account", FULL |FULL, ACCESS_ALLOWED_ACE_TYPE, OBJECT_IN +HERIT_ACE | CONTAINER_INHERIT_ACE);
Meaning to assign the account $account the permission FULL on Folder level and Full on subfolder and files level, Which works fine and it does assign the Full control permission to $account (well, it seems so to me, then again I could be wrong).

However, If I wanted to assign the List or the Add & Read permission to $account, knowing that List permission is (RX)(Not Specified) or Add & Read which is (RWX)(RX). I fail miserably because I do not know how to go about it. I am not sure on what to substitute instead of the FULL|FULL as above to obtain Add & Read or List permissions. Can someone please explain or show me how to do this?

Also. In my script I have a perl/Tk based form (please see following code) where two sets of radio buttons are displayed, each radio button resembles an access type and one set of radio buttons are for folder permissions and the other is for subfolders and files assignments. Then I obtain the values for $folder_ace_var and $subfolder_ace_var. as such:
foreach my $p ('NO_ACCESS', 'FULL','READ', 'WRITE' ,'CHANGE','GENERIC_ +ALL') { $left_frame->Radiobutton( -text => "ACE : $p", -variable => \ + $folder_ace_var, -relief => ' +flat', -value => $ +p, )->pack(@pl); } foreach my $p ('NO_ACCESS', 'FULL','READ', 'WRITE' ,'CHANGE','GENE +RIC_ALL') { $right_frame->Radiobutton( -text => "ACE : $p", -variable => \ + $subfolder_ace_var, -relief => ' +flat', -value => $ +p, )->pack(@pl); }
Now, when I use this line:
$perms->Add("$account", $folder_ace_var | $subfolder_ace_var, ACCESS_ALLOWED_ACE_TYPE, OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE);
It doesn’t work;

My question is how I can tell Perl to treat those two variables as constants.
Many Thanks in advance to you replays (and examples), your help is highly appreciated because my back side is under a bit of heat at the moment.

In reply to Assigning Permissions by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.