views:

405

answers:

3

For example some parts of the client spec map files from a 'Published' depot. Is there a way for these so-called published maps to be forced read-only, i.e. they cannot be opened for edit?

For example (ignoring [not editable]):

//Development/foo/... //client/foo/...
//Published/bar/1.0/... //client/bar/... [not editable]
//Published/qux/2.0/... //client/qux/... [not editable]

In other words I want to prevent files from being opened (say, being locked by default) and am wondering if this can be enforced at the client spec level.

If not, is there a way available without making the 'Published' depot read-only to certain users?

+1  A: 

you can use p4 lock, which prohibits others from submitting changes.

you can also manage user access, see p4 protect and p4 group. i believe this can be used on a file by file basis.

akf
p4 lock locks open files. I want to prevent files from being opened on any client and am wondering if this can be enforced at the client spec level.
Jonathon Watney
A: 

You could create a dummy client and lock those files on the dummy client. Then, just don't let anyone use that client, e.g. by putting it on a server.

Adam Rosenfield
So, create a dummy client mapping the files I want to lock, open them for edit and then lock them?
Jonathon Watney
+4  A: 

The only way to do this properly is via the Perforce permissions table. You get to this either with p4 protect command or via the Admin menu in P4V.

Just open it up - you need admin rights - and add a line to the table to mark those files as read only. That will allow your clients to sync to the files but not be allowed to open for edit (or delete etc).

You have ultimate control in the permissions table. You could also refine this to allow just a subset of users to be able to modify the file, while everyone else sees it as read only.

The Perforce admin guide is pretty good on the permissions table. Direct link here.

Greg Whitfield
Great, Thanks. Not exactly what I was looking for but I think I can work with it.
Jonathon Watney