From 27ae9095639bb228a1b7ff86a3ebe4264abf05be Mon Sep 17 00:00:00 2001
From: mschaefers <mschaefers@scoop-gmbh.de>
Date: Thu, 29 Nov 2012 12:33:09 -0500
Subject: [PATCH] feature: when using LdapUserService one can configure Gitblit to fetch all users from ldap that can possibly login. This allows to see newly generated LDAP users instantly in Gitblit. By now an LDAP user had to log in once to appear in GitBlit.
---
src/com/gitblit/client/RegistrantPermissionsTableModel.java | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/com/gitblit/client/RegistrantPermissionsTableModel.java b/src/com/gitblit/client/RegistrantPermissionsTableModel.java
index 91acec8..28d2534 100644
--- a/src/com/gitblit/client/RegistrantPermissionsTableModel.java
+++ b/src/com/gitblit/client/RegistrantPermissionsTableModel.java
@@ -36,7 +36,7 @@
List<RegistrantAccessPermission> permissions;
enum Columns {
- Registrant, Permission;
+ Registrant, Type, Permission;
@Override
public String toString() {
@@ -72,6 +72,8 @@
switch (col) {
case Registrant:
return Translation.get("gb.name");
+ case Type:
+ return Translation.get("gb.type");
case Permission:
return Translation.get("gb.permission");
}
@@ -88,13 +90,23 @@
public Class<?> getColumnClass(int columnIndex) {
if (columnIndex == Columns.Permission.ordinal()) {
return AccessPermission.class;
+ } else if (columnIndex == Columns.Type.ordinal()) {
+ return RegistrantAccessPermission.class;
}
return String.class;
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
- return columnIndex == Columns.Permission.ordinal();
+ if (columnIndex == Columns.Permission.ordinal()) {
+ // in order for the permission to be editable it must be
+ // explicitly defined on the object. regex permissions are inherited
+ // and therefore can not be directly manipulated unless the current
+ // object is the source of the regex (i.e. a user or team with explicit
+ // regex definition)
+ return permissions.get(rowIndex).mutable;
+ }
+ return false;
}
@Override
@@ -104,6 +116,8 @@
switch (col) {
case Registrant:
return rp.registrant;
+ case Type:
+ return rp;
case Permission:
return rp.permission;
}
--
Gitblit v1.9.1