From a4231d30c4d2765c80f57df79cd1d4d39a9795ea Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Tue, 30 Oct 2012 17:05:30 -0400 Subject: [PATCH] Added null checkinng and logging for edit user permissions (issue 155) --- src/com/gitblit/Constants.java | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java index 970c3db..e7812ee 100644 --- a/src/com/gitblit/Constants.java +++ b/src/com/gitblit/Constants.java @@ -86,6 +86,8 @@ public static final String CONFIG_CUSTOM_FIELDS = "customFields"; + public static final String ISO8601 = "yyyy-MM-dd'T'HH:mm:ssZ"; + public static String getGitBlitVersion() { return NAME + " v" + VERSION; } @@ -319,9 +321,9 @@ * The access permissions available for a repository. */ public static enum AccessPermission { - NONE("N"), VIEW("V"), CLONE("R"), PUSH("RW"), CREATE("RWC"), DELETE("RWD"), REWIND("RW+"); + NONE("N"), EXCLUDE("X"), VIEW("V"), CLONE("R"), PUSH("RW"), CREATE("RWC"), DELETE("RWD"), REWIND("RW+"); - public static final AccessPermission [] NEWPERMISSIONS = { VIEW, CLONE, PUSH, CREATE, DELETE, REWIND }; + public static final AccessPermission [] NEWPERMISSIONS = { EXCLUDE, VIEW, CLONE, PUSH, CREATE, DELETE, REWIND }; public static AccessPermission LEGACY = REWIND; @@ -384,6 +386,18 @@ REPOSITORY, USER, TEAM; } + public static enum PermissionType { + EXPLICIT, OWNER, REGEX; + } + + public static enum GCStatus { + READY, COLLECTING; + + public boolean exceeds(GCStatus s) { + return ordinal() > s.ordinal(); + } + } + @Documented @Retention(RetentionPolicy.RUNTIME) public @interface Unused { -- Gitblit v1.9.1