From d0d438f480e29a5ebaf64449a5c3e7f4ebb13690 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 11 May 2011 22:33:16 -0400
Subject: [PATCH] Clarified access restrictions.
---
src/com/gitblit/Constants.java | 47 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java
index 186193e..7d1758d 100644
--- a/src/com/gitblit/Constants.java
+++ b/src/com/gitblit/Constants.java
@@ -4,20 +4,49 @@
public final static String NAME = "Git:Blit";
- public final static String VERSION = "0.0.1";
-
- public final static String ADMIN_ROLE = "admin";
-
- public final static String PULL_ROLE = "pull";
-
- public final static String PUSH_ROLE = "push";
+ public final static String VERSION = "0.1.0-SNAPSHOT";
+
+ public final static String ADMIN_ROLE = "#admin";
+
+ public final static String PROPERTIES_FILE = "gitblit.properties";
+
+ public static enum AccessRestrictionType {
+ NONE, PUSH, CLONE, VIEW;
+
+ public static AccessRestrictionType fromName(String name) {
+ for (AccessRestrictionType type : values()) {
+ if (type.name().equalsIgnoreCase(name)) {
+ return type;
+ }
+ }
+ return NONE;
+ }
+
+ public boolean atLeast(AccessRestrictionType type) {
+ return this.ordinal() >= type.ordinal();
+ }
+
+ public String toString() {
+ switch (this) {
+ case NONE:
+ return "Anonymous View, Clone, & Push";
+ case PUSH:
+ return "Anonymous View & Clone, Authenticated Push";
+ case CLONE:
+ return "Anonymous View, Authenticated Clone & Push";
+ case VIEW:
+ return "Authenticated View, Clone, & Push";
+ }
+ return "none";
+ }
+ }
public static String getGitBlitVersion() {
return NAME + " v" + VERSION;
}
-
+
public static String getJGitVersion() {
- return "JGit 0.11.3";
+ return "JGit 0.12.1";
}
public static String getRunningVersion() {
--
Gitblit v1.9.1