From e8df3c10e12e4381cc07845a0f04e85f05c81f35 Mon Sep 17 00:00:00 2001 From: paulr Date: Tue, 8 Nov 2011 05:15:06 +1100 Subject: [PATCH] permissions resolution now works for repos. added a permissions unit test fixed group create to add owner user as a member --- unittests/permissionunittest.php | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/unittests/permissionunittest.php b/unittests/permissionunittest.php index ee180bf..f5fd49c 100644 --- a/unittests/permissionunittest.php +++ b/unittests/permissionunittest.php @@ -52,7 +52,7 @@ gwvp_createGitRepo("utrepo2", gwvp_getUserId(null, "user2"), "repo1", null, 2); gwvp_createGitRepo("utrepo3", gwvp_getUserId(null, "user3"), "repo1", null, 2); gwvp_createGitRepo("utrepo4", gwvp_getUserId(null, "user4"), "repo1", null, 2); gwvp_createGitRepo("utrepo5", gwvp_getUserId(null, "user5"), "repo1", null, 2); -gwvp_createGitRepo("utrepo6", gwvp_getUserId(null, "user6"), "repo1", null, 2); +gwvp_createGitRepo("utrepo6", gwvp_getUserId(null, "user6"), "repo1", null, 0); // now the fun part gwvp_addRepoPermission($repoid, $permtype, $permref) gwvp_addRepoPermission(gwvp_GetRepoId("utrepo1"), "write", "user:".gwvp_getUserId(null, "user3")); @@ -74,6 +74,8 @@ echo "User3 pers to repo5 = $pers - should be 0\n"; $pers = gwvp_resolvRepoPerms(gwvp_getUserId(null, "user2"), gwvp_GetRepoId("utrepo5")); echo "User2 pers to repo5 = $pers - should be 3 (admin)\n"; +$pers = gwvp_resolvRepoPerms(-1, gwvp_GetRepoId("utrepo6")); +echo "anon pers to repo5 = $pers - should be 2\n"; ?> \ No newline at end of file -- 1.7.0.4