How to check permission for other users in gitolite?

1.3k views Asked by At

I found a link to documentation which says the ssh info command can be used to look at permissions for other users, but I havent been able to get it to work.

http://gitolite.com/gitolite/g2/info_expand.html

What am I doing wrong?

$ ssh git@ahp0625 info git <user>

Usage:  gitolite info [-lc] [-ld] [-json] [<repo name pattern>]

List all existing repos you can access, as well as repo name patterns you can
create repos from (if any).

    '-lc'       lists creators as an additional field at the end.
    '-ld'       lists description as an additional field at the end.
    '-json'     produce JSON output instead of normal output

The optional pattern is an unanchored regex that will limit the repos searched, in both cases. It might speed up things a little if you have more than a few thousand repos.

2

There are 2 answers

0
sitaram On BEST ANSWER

From the help message you got, you're using v3, and that too a recent one.

v3 info does not allow that syntax.
See src/commands/sudo for a more general way to run any command as some other user.
(You need to add 'sudo', with a trailing comma, in the list of enabled commands in the rc file -- See Rc.pm).

1
nicocesar On

Try:

ssh git@ahp0625 info git . <user>

Since it seems that the patern for repos is mandatory, so you can cheat using period, as it says in the link you posted:

The "info" command shows you all the repos (and repo patterns) in the config file that you have been given any kind of access to. If you supply an optional pattern the output will be limited to repos matching that pattern. If you're an admin you can append a list of users to see their permissions instead of your own; in this mode the pattern is mandatory, even if you just use . to cheat.