|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Assigning Permissionsby BlueBlazerRegular (Friar) |
| on Sep 12, 2002 at 14:04 UTC ( [id://197292]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Update (9/13/2): As BrowserUk mentions, I was unaware of the larger picture here, therefore creating a long-winded post that unfortunately has the rather large drawback of not working (or to be more accurate - not doing what it should). Apparently I have a rather long way to go to reach true enlightenment. So this update is a warning to all of you who may stumble across this later on - don't use it!
There appear to be two questions here:
The first is in regards to what the various labels are for the various permissions. You know what 'FULL' is, but the others aren't as clear. Unfortunately, I can't help you with this.
The second question has to do with the Tk code. In checking this out, I ran into something strange. In my test, I'm printing out what is being passed to the sub-routine and getting some strange results, due to the use of the '|' in the call.
This makes me wonder what you are using '|' for. Is it being used in its normal Perl way as a bitwise OR? Or are you trying to choose between two options (i.e., the parameter could be the $folder_ace_var OR the $subfolder_ace_var)? Or is supposed to be part of the parameters being passed (i.e., a literal '|')?
First off, a bitwise OR does very strange stuff to the strings when they are passed to the sub-routine, so I'm pretty sure that is NOT what you are trying to do. Using '||' instead of '|' does what it is expected (choose between two options), but the way you have it written, you will always get OBJECT_INHERIT_ACE, regardless of which permission was set. And I'm confused on the order of the parameters - you pass $folder_ace_var before $subfolder_ace_var, but pass OBJECT_INHERIT_ACE before CONTAINER_INHERIT_ACT (it would seem that the OBJECT (the sub-folder or file) would be in the CONTAINER (the folder), not the other way around, but then rules don't have to make sense). Also, I get warnings on using the barewords ACCESS_ALLOWED_ACE_TYPE, OBJECT_INHERIT_ACE, and CONTAINER_INHERIT_ACE. Quoting these values would get rid of these errors. Your call would now look like this:
If this is what you are trying to do, then a better way to do this would be:
That leaves us with the third choice - that the '|' is part of the string being passed. If so, then we need to put quotes around the parameters to get the '|' to pass to the sub-routine correctly. For this option, the call would look like this:
The test program below shows how the various choices will affect the results. This is getting a mite long-winded (which, unfortunately, is a curse of mine), so I'll just end with I hope this has been helpful.
And without further ado, the code:
Pat
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||