From: James Moger Date: Fri, 28 Mar 2014 15:39:23 +0000 (-0400) Subject: Finish user and team administration commands X-Git-Tag: v1.5.0~68^2~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd45b5fe5ae88c1d526211e67068ce7b2a066d70;p=gitblit.git Finish user and team administration commands --- diff --git a/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java b/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java index 710ec4eb..d0ec58f0 100644 --- a/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java +++ b/src/main/java/com/gitblit/transport/ssh/gitblit/TeamsDispatcher.java @@ -72,7 +72,7 @@ public class TeamsDispatcher extends DispatchCommand { } } - @CommandMetaData(name = "new", description = "Create a new team") + @CommandMetaData(name = "new", aliases = { "add" }, description = "Create a new team") @UsageExample(syntax = "${cmd} contributors --canFork --canCreate") public static class NewTeam extends TeamCommand { @@ -148,7 +148,7 @@ public class TeamsDispatcher extends DispatchCommand { protected List fieldValues = new ArrayList(); protected enum Field { - mailingList, canAdmin, canFork, canCreate; + mailingList, preReceive, postReceive, canAdmin, canFork, canCreate; static Field fromString(String name) { for (Field field : values()) { @@ -185,6 +185,14 @@ public class TeamsDispatcher extends DispatchCommand { team.mailingLists.clear(); team.mailingLists.addAll(fieldValues); break; + case preReceive: + team.preReceiveScripts.clear(); + team.preReceiveScripts.addAll(fieldValues); + break; + case postReceive: + team.postReceiveScripts.clear(); + team.postReceiveScripts.addAll(fieldValues); + break; case canAdmin: team.canAdmin = toBool(value); break; diff --git a/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java b/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java index 4f604a2f..1a6dee46 100644 --- a/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java +++ b/src/main/java/com/gitblit/transport/ssh/gitblit/UsersDispatcher.java @@ -74,7 +74,7 @@ public class UsersDispatcher extends DispatchCommand { } } - @CommandMetaData(name = "new", description = "Create a new user account") + @CommandMetaData(name = "new", aliases = { "add" }, description = "Create a new user account") @UsageExample(syntax = "${cmd} john 12345 --email john@smith.com --canFork --canCreate") public static class NewUser extends UserCommand { @@ -165,7 +165,7 @@ public class UsersDispatcher extends DispatchCommand { protected List fieldValues = new ArrayList(); protected enum Field { - name, displayName, email, password, canAdmin, canFork, canCreate; + name, displayName, email, password, canAdmin, canFork, canCreate, disabled; static Field fromString(String name) { for (Field field : values()) { @@ -253,6 +253,9 @@ public class UsersDispatcher extends DispatchCommand { case canCreate: user.canCreate = toBool(value); break; + case disabled: + user.disabled = toBool(value); + break; default: throw new UnloggedFailure(1, String.format("Field %s was not properly handled by the set command.", fieldName)); }