views:

59

answers:

1

Hey Everyone,

Im trying to setup repository permissions with Mercurial/Tortoisehg. What I would like to do is have 1 person be the administrator and only that person is allowed to commit/push/pull to the repository. Everyone else would have to send that person a patch if they want to get their changes into the repository.

Thanks for any help, Metropolis

+2  A: 

That functionality depends on how people are accessing your repository, which could be:

  1. local file access
  2. ssh network access
  3. http access via built-in hg serve
  4. http access via external web-server

You can see pluses and minuses along with instructions for each on the PublishingRepositories wiki page.

Per-user access controls are available in options 1,2, and 4 above. With options 1 (file) and 2 (ssh) you'll be counting on your operating system's built in user controls. With option 2 (ssh) you could also mix in the shared ssh techniques for additional access controls. With option 4 (external http server) the sky is the limit. Authentication comes from the HTTP layer (e.g: apache) and mercurial uses that info along with the allow_push settings to grant access.

In cases 1, 2, or 4 you can also mix in the ACL extension for even more fine grained control.

Bottom-line: totally doable and commonly done, but you've got some decisions to make about how depending on how public your repo is and where you want to be controlling credentials.

Ry4an
Thanks alot for the information Ry4n. What I am trying to do is store the repositories in a CR on a local server that can be accessed everywhere in the company. But only the person that puts the repository there can make changes to the repo. Everyone else can only clone/pull from it. Is this possible?
Metropolis
Also, this is a Windows server without apache :/
Metropolis
Can I just set the permissions for the folders and that will take care of it?
Metropolis
Awesome.....it worked. I just set the permissions on the windows server for the folders so that only the person that owns the repositories can write to them, and everyone else can read. Thanks again for your help Ry4n
Metropolis
Yeah, that's option one and I'm glad to hear it worked for you :)
Ry4an

related questions