summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-10-10 22:29:36 -0400
committerJames Moger <james.moger@gitblit.com>2012-10-10 22:29:36 -0400
commit7f70511e9a13f4801e4e941affad6fc7b579c79d (patch)
treea63a3594344642d16b82ad99ac65f3f19d51aa9d /tests
parent58e7ec808177e53981792b1489695a51d2c91fe5 (diff)
downloadgitblit-7f70511e9a13f4801e4e941affad6fc7b579c79d.tar.gz
gitblit-7f70511e9a13f4801e4e941affad6fc7b579c79d.zip
Support Team canAdmin, canCreate, and canFork (issue 36)
Diffstat (limited to 'tests')
-rw-r--r--tests/com/gitblit/tests/PermissionsTest.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/com/gitblit/tests/PermissionsTest.java b/tests/com/gitblit/tests/PermissionsTest.java
index 41ff5a63..2f47a489 100644
--- a/tests/com/gitblit/tests/PermissionsTest.java
+++ b/tests/com/gitblit/tests/PermissionsTest.java
@@ -2414,6 +2414,33 @@ public class PermissionsTest extends Assert {
assertFalse("user CAN delete!", user.canDelete(repository));
assertFalse("user CAN edit!", user.canEdit(repository));
+ }
+
+ @Test
+ public void testAdminTeamInheritance() throws Exception {
+ UserModel user = new UserModel("test");
+ TeamModel team = new TeamModel("team");
+ team.canAdmin = true;
+ user.teams.add(team);
+ assertTrue("User did not inherit admin privileges", user.canAdmin());
+ }
+
+ @Test
+ public void testForkTeamInheritance() throws Exception {
+ UserModel user = new UserModel("test");
+ TeamModel team = new TeamModel("team");
+ team.canFork = true;
+ user.teams.add(team);
+ assertTrue("User did not inherit fork privileges", user.canFork());
+ }
+ @Test
+ public void testCreateTeamInheritance() throws Exception {
+ UserModel user = new UserModel("test");
+ TeamModel team = new TeamModel("team");
+ team.canCreate= true;
+ user.teams.add(team);
+ assertTrue("User did not inherit create privileges", user.canCreate());
}
+
}