[p4] perforce-user Digest, Vol 17, Issue 11

David Faison dfaison at photon.com
Thu May 11 13:43:50 PDT 2006


You could auto-generate the protection statements if you wanted.

Using XP command shell you could script as follows:
___________________________________________________________________

REM first capture existing protections 
REM while stripping out old auto-generated entries
    p4 protect -o | find /v "//depot/private/" > protect.txt

REM your auto-generated entries will fall at bottom of protection list
REM so this first line ensures that nobody inherits access from above.
    echo  write group developers * -//depot/private/... >> protect.txt

REM now auto-generate entries for each user
    for /f %x in ('p4 users') do (
        echo write user %%x * //depot/private/%%x/... >> protect.txt
    )
REM and finally shove your new protection list back into the server.
    type protect.txt | p4 protect -i

___________________________________________________________________

All UN*X shells have equivalent features so with a little work you can
get this working on any OS.

David Faison
Photon Research Associates
dfaison at photon.com

> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com]On Behalf Of 
> Weintraub, David
> Sent: Wednesday, May 10, 2006 4:31 PM
> To: perforce-user at perforce.com
> Subject: [p4] Giving each user a private sandbox

Is there someway to setup Perforce's protection tables to do something
like this:
 
	write user %USER% * //depot/Private/%USER%/...

So, that "bob" had permission in //depot/Private/bob/... and "tom" had
write permission in //depot/Private/tom/..., etc.

I would like to setup separate sandboxes for each user, but I really
don't want to add 90 plus lines in my Perforce protection table to do
this.

My biggest fear isn't Bob messing around with Tom's private directory,
it's Bob, Tom, and everyone else deciding they could use more than one
private directory, so I end up with thousands of directories under
//depot/Private instead of one for each user. I'd be satisfied with
users being able to write to //depot/Private/*/..., but not be able to
create another directory under //depot/Private if it previously didn't
exist.

Has anyone done anything like this? 

--
David Weintraub
david.weintraub at bankofamerica.com
david.weintraub at bofasecurities.com




More information about the perforce-user mailing list