diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2015-03-11 22:26:05 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2015-03-13 06:22:23 +0530 |
commit | 8786e256e24b3365999fce058249af525ed34655 (patch) | |
tree | 479e45f7e0aa1ed9864a57a5412a50bf567ee452 /t | |
parent | prevent info leak when gitolite-shell is used as $SHELL... (diff) | |
download | gitolite-gentoo-8786e256e24b3365999fce058249af525ed34655.tar.gz gitolite-gentoo-8786e256e24b3365999fce058249af525ed34655.tar.bz2 gitolite-gentoo-8786e256e24b3365999fce058249af525ed34655.zip |
perms: list available roles, plus several other changes...
(much thanks to Tony Finch!)
- show valid roles and their access rights, for the given repo ("-lr")
- check a role not just against the rc, but against the roles that this
specific repo actually uses, which may be a smaller subset. (This is the
most important improvement in this patch; the rest is just fluff!)
- fixup usage message
WARNING: minor backward compat breakage: 'ssh ... perms -l repo' no longer
works; the '-l' goes *after* the repo name now.
Diffstat (limited to 't')
-rwxr-xr-x | t/0-me-first.t | 1 | ||||
-rwxr-xr-x | t/daemon-gitweb-via-perms.t | 4 | ||||
-rwxr-xr-x | t/perm-roles.t | 8 | ||||
-rwxr-xr-x | t/perms-groups.t | 4 | ||||
-rwxr-xr-x | t/sequence.t | 6 | ||||
-rwxr-xr-x | t/wild-1.t | 2 | ||||
-rwxr-xr-x | t/wild-2.t | 2 |
7 files changed, 14 insertions, 13 deletions
diff --git a/t/0-me-first.t b/t/0-me-first.t index 822d1af..8c9d12b 100755 --- a/t/0-me-first.t +++ b/t/0-me-first.t @@ -22,6 +22,7 @@ confreset;confadd ' repo cc/..* C = u4 RW+ = CREATOR u5 + R = READERS '; try "ADMIN_PUSH set1; !/FATAL/" or die text(); diff --git a/t/daemon-gitweb-via-perms.t b/t/daemon-gitweb-via-perms.t index 0d19371..8707e19 100755 --- a/t/daemon-gitweb-via-perms.t +++ b/t/daemon-gitweb-via-perms.t @@ -53,7 +53,7 @@ try " glt perms u1 bar/u1/try1 + READERS daemon !/./ - glt perms u1 -l bar/u1/try1 + glt perms u1 bar/u1/try1 -l /READERS daemon/ find $h/repositories -name git-daemon-export-ok @@ -65,7 +65,7 @@ try " glt perms u1 bar/u1/try2 + READERS gitweb - glt perms u1 -l bar/u1/try2 + glt perms u1 bar/u1/try2 -l /READERS gitweb/ find $h/repositories -name git-daemon-export-ok diff --git a/t/perm-roles.t b/t/perm-roles.t index a1c4f85..03403d6 100755 --- a/t/perm-roles.t +++ b/t/perm-roles.t @@ -64,7 +64,7 @@ glt push u1 file:///foo/u1/u1r1 t1 # add u2 to WRITERS echo WRITERS \@g2 | glt perms u1 foo/u1/u1r1 -glt perms u1 -l foo/u1/u1r1 +glt perms u1 foo/u1/u1r1 -l /WRITERS \@g2/ glt fetch u1 @@ -96,7 +96,7 @@ glt push u2 file:///foo/u1/u1r1 t2 # change u2 to READERS echo READERS u2 | glt perms u1 foo/u1/u1r1 -glt perms u1 -l foo/u1/u1r1 +glt perms u1 foo/u1/u1r1 -l /READERS u2/ glt fetch u1 @@ -122,7 +122,7 @@ try " gitolite compile; ok or die compile failed /usr/bin/printf 'READERS u6\\nMANAGERS u2\\n' | glt perms u1 foo/u1/u1r1 ok; !/Invalid role 'MANAGERS'/ - glt perms u1 -l foo/u1/u1r1 + glt perms u1 foo/u1/u1r1 -l "; cmp 'READERS u6 @@ -169,7 +169,7 @@ gitolite compile; ok or die compile failed # add u2 to now valid TESTERS echo TESTERS u2 | glt perms u1 foo/u1/u1r1 !/Invalid role 'TESTERS'/ -glt perms u1 -l foo/u1/u1r1 +glt perms u1 foo/u1/u1r1 -l "; cmp 'TESTERS u2 diff --git a/t/perms-groups.t b/t/perms-groups.t index a4b6839..5de75be 100755 --- a/t/perms-groups.t +++ b/t/perms-groups.t @@ -51,7 +51,7 @@ try " # \@devs can R try1 echo READERS \@devs | glt perms u1 bar/u1/try1; ok - glt perms u1 -l bar/u1/try1 + glt perms u1 bar/u1/try1 -l /READERS \@devs/ !/WRITERS \@leads/ @@ -68,7 +68,7 @@ try " # combo of previous 2 /usr/bin/printf 'READERS \@devs\\nWRITERS \@leads\\n' | glt perms u1 bar/u1/try1; ok - glt perms u1 -l bar/u1/try1 + glt perms u1 bar/u1/try1 -l /READERS \@devs/ /WRITERS \@leads/ glt info u1 -lc diff --git a/t/sequence.t b/t/sequence.t index 87f3731..81fabfc 100755 --- a/t/sequence.t +++ b/t/sequence.t @@ -34,7 +34,7 @@ try " /To file:///foo/u1/bar/ /\\[new branch\\] master -> master/ echo WRITERS u2 | glt perms u1 foo/u1/bar - glt perms u1 -l foo/u1/bar + glt perms u1 foo/u1/bar -l /WRITERS u2/ # expand glt info u2 @@ -78,7 +78,7 @@ try " /To file:///foo/u1/bar/ /\\[new branch\\] master -> master/ echo WRITERS u2 | glt perms u1 foo/u1/bar - glt perms u1 -l foo/u1/bar + glt perms u1 foo/u1/bar -l /WRITERS u2/ # expand glt info u2 @@ -106,7 +106,7 @@ try " echo READERS u2 | glt perms u1 -c foo/u1/baz /Initialized empty Git repository in .*/foo/u1/baz.git/ - glt perms u1 -l foo/u1/baz + glt perms u1 foo/u1/baz -l /READERS u2/ # expand glt info u2 @@ -93,7 +93,7 @@ glt clone u5 file:///foo/u4/a12 u5a12; !ok; /R any foo/u4/a12 u5 DENIED by f glt perms u4 foo/u4/a12 + READERS u5 glt perms u4 foo/u4/a12 + WRITERS u6 -glt perms u4 -l foo/u4/a12 +glt perms u4 foo/u4/a12 -l "; cmp 'READERS u5 @@ -94,7 +94,7 @@ glt perms u4 foo/u4/a12 + READERS u5 glt perms u4 foo/u4/a12 + WRITERS u6 # getperms -glt perms u4 -l foo/u4/a12 +glt perms u4 foo/u4/a12 -l "; cmp 'READERS u5 |