m0llu$k has asked for the wisdom of the Perl Monks concerning the following question:
Wise Perl Monks,
I'm currently creating a perl script and a section of this script locks down the directory by changing permissions. Being new to perl, I'm trying to incorporate some logic-based technical implementation during update group permissions step. Here is rough overview:
I am creating a directory based on user input. One of the questions determines the main team, in order to segregate the new directory from the other teams (5 teams total: payroll, accounting, hr, management, technical). So for example, all of the teams listed have access to the script and some users have access on multiple teams. So when a user runs the script, I need to build the logic to determine the list of current groups that the user is in and see if they are part of the group that they are trying to change permissions of the directory too. If they are, the directory will have its group changed to what was selected. If they are not, currently, the default group assignment of the user goes to the directory. However, I want to add code to clarify to the user that they will need to request permission for the group of which they did not have access too.
Any suggestions on how to do this? I'm currently getgrnam to discover $members, but feel this is the wrong direction. Also, I'm using system calls to execute "chgrp" and "chmod." Are there built-in perl commands to execute these?
Thanks you wise perl monks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Logic-Based Permission Check
by toolic (Bishop) on Jul 30, 2013 at 20:51 UTC | |
by Laurent_R (Canon) on Jul 30, 2013 at 21:23 UTC |