Home Forums OS X Server and Client Discussion File Serving Enabling a user to create a new directory with permissions

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #373493
    Demani
    Participant

    The ultimate goal would be to have a file that managers could double-click and create a new folder containing a specific layout with set permissions. Just duplicating a folder doesn’t keep the explicit ACLs so I need to do something a little more complex.

    I have the directory creation already in place:

    [code] #!/bin/bash

    mkdir 08_Client_Project_JobCode/
    mkdir 08_Client_Project_JobCode/01_producers
    mkdir 08_Client_Project_JobCode/01_producers/bids
    mkdir 08_Client_Project_JobCode/01_producers/bids/approved
    mkdir 08_Client_Project_JobCode/01_producers/bids/overage
    mkdir 08_Client_Project_JobCode/01/bids/dead
    mkdir 08_Client_Project_JobCode/01/boards_brief
    mkdir 08_Client_Project_JobCode/01/correspondence
    mkdir 08_Client_Project_JobCode/01/po
    mkdir 08_Client_Project_JobCode/01/schedule
    mkdir 08_Client_Project_JobCode/01/_miscellaneous
    [/code]

    This is one section of that (I broke things out into individual sections so it would be easier to read and modify). One side question-anyone know how to create a bullet in a folder name-I’d like Miscellaneous to sort to the bottom instead of the top. What worked at the command line wasn’t working in the script.

    At this point I need to add my ACLs, so I do this:
    [code]mkdir 08_Client_Project_JobCode/
    chmod +I 08_Client_Project_JobCode
    #remove any inherited ACLs

    mkdir 08_Client_Project_JobCode/01_producers

    mkdir 08_Client_Project_JobCode/01_producers/bids
    chmod +ai “postproducers allow read,write” 08_Client_Project_JobCode/01_producers/bids
    mkdir 08_Client_Project_JobCode/01_producers/bids/approved
    mkdir 08_Client_Project_JobCode/01_producers/bids/overage
    mkdir 08_Client_Project_JobCode/01_producers/bids/dead
    mkdir 08_Client_Project_JobCode/01_producers/boards_brief
    chmod +ai “postproducers allow read,write” 08_Client_Project_JobCode/01_producers/boards_brief
    mkdir 08_Client_Project_JobCode/01_producers/correspondence
    chmod +ai “postproducers allow read,write” 08_Client_Project_JobCode/01_producers/correspondence
    mkdir 08_Client_Project_JobCode/01_producers/po
    chmod +ai “postproducers allow read,write” 08_Client_Project_JobCode/01_producers/po
    mkdir 08_Client_Project_JobCode/01_producers/schedule
    chmod +ai “postproducers allow read,write” 08_Client_Project_JobCode/01_producers/schedule
    mkdir 08_Client_Project_JobCode/01_producers/_miscellaneous
    chmod +ai “postproducers allow read,write” 08_Client_Project_JobCode/01_producers/miscellaneous

    chmod +a “postproducers allow read” 08_Client_Project_JobCode/01_producers
    #only allow read access to the top level, so that the immediate subfolders can not be changed.
    [/code]
    Does that all look right? Is there any easier way to get all this to work (since there are actually seven sections to do)?

    And finally (and this is really the meat of the question) what can I do to create a script that any of the project managers can run? I don’t care so much about assuming the name (though it would be nice to prompt them for the name before creation)-they’ll create the template and then change the top level folder to whatever project name they need. But I’d love it if they could just double-click an icon (maybe an Automator app?) on their desktop and have it create those folders. Any suggestions? Do I need to create the entire structure giving the managers all access first, then go through and have the script reassign ownership to the groups afterwards (there is one sub-directory that they won’t have access to afterwards)? My head is swimming and at this point I’m looking for some perspective on this.
    Thanks for any insight.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Comments are closed