summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-11-11 17:59:15 -0500
committerJames Moger <james.moger@gitblit.com>2011-11-11 17:59:15 -0500
commitefe8ecb216b0e2f2f1dceb26c4f21dcec1fb497c (patch)
tree6f3e4cc56268819d98210150811283e418057cfc /tests
parentd65f712ea3d8941f4b9145c0630c30c20af80d13 (diff)
downloadgitblit-efe8ecb216b0e2f2f1dceb26c4f21dcec1fb497c.tar.gz
gitblit-efe8ecb216b0e2f2f1dceb26c4f21dcec1fb497c.zip
Revised user access checks to account for repository ownership.
Repository owners no longer have to be explicitly selected to grant them access to Git, feeds, and zip downloads. Idea from Github/dadalar.
Diffstat (limited to 'tests')
-rw-r--r--tests/com/gitblit/tests/GitBlitTest.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/com/gitblit/tests/GitBlitTest.java b/tests/com/gitblit/tests/GitBlitTest.java
index 1d20ced9..669b25ac 100644
--- a/tests/com/gitblit/tests/GitBlitTest.java
+++ b/tests/com/gitblit/tests/GitBlitTest.java
@@ -52,9 +52,10 @@ public class GitBlitTest extends TestCase {
model.canAdmin = false;
assertFalse("Admin should not have #admin!", model.canAdmin);
String repository = GitBlitSuite.getHelloworldRepository().getDirectory().getName();
- assertFalse("Admin can still access repository!", model.canAccessRepository(repository));
+ RepositoryModel repositoryModel = GitBlit.self().getRepositoryModel(model, repository);
+ assertFalse("Admin can still access repository!", model.canAccessRepository(repositoryModel));
model.addRepository(repository);
- assertTrue("Admin can't access repository!", model.canAccessRepository(repository));
+ assertTrue("Admin can't access repository!", model.canAccessRepository(repositoryModel));
assertEquals(GitBlit.self().getRepositoryModel(model, "pretend"), null);
assertNotNull(GitBlit.self().getRepositoryModel(model, repository));
assertTrue(GitBlit.self().getRepositoryModels(model).size() > 0);