Reputation: 23586
How does Gitolite check that current user has a write/read permission to given repository? Is this done by custom shell? If yes then how it work?
Upvotes: 1
Views: 995
Reputation: 1329492
It is using the ssh forced command mechanism to call the gitolite-shell script.
Gitolite register a user by adding to the ~git/ssh/authorized_keys a line similar to:
command="/devit_home/users/vobadm/gitpoc/ce7/gitolite/bin/gitolite-shell gitoliteadm",no-port-forwarding,no-X11-for warding,no-agent-forwarding,no-pty ssh-rsa AAAAB3N
The user id is derived directly from the name of the public key.
For more, see "How do programs like gitolite work?".
The read/write access are the declared in the gitolite.conf
file.
Most of gitolite's power is in the
conf/gitolite.conf
file, which specifies detailed access control for repos.
Everything except adding users happens from this file.
@staff = dilbert alice # line 1
@projects = foo bar # line 2
repo @projects baz # line 3
RW+ = @staff # line 4
- master = ashok # line 5
RW = ashok # line 6
R = wally # line 7
Upvotes: 1