Don't hyperlink non-internal groups

When an external group (such as LDAP) is used in a permission rule,
don't attempt to link to the group in the internal account system UI.
The group won't load successfully. Instead just display the name and
put the UUID into a tooltip to show the full DN.

Change-Id: I8fbb67a36da5d5fcb69b4f90bfedbc2638896886
This commit is contained in:
Shawn O. Pearce
2012-06-05 09:01:42 -07:00
parent 7e7e5edf8b
commit 6fe3e99bc9
3 changed files with 19 additions and 8 deletions

View File

@@ -79,6 +79,12 @@ public final class AccountGroup {
}
}
/** @return true if the UUID is for a group managed within Gerrit. */
public static boolean isInternalGroup(AccountGroup.UUID uuid) {
return uuid.get().startsWith("global:")
|| uuid.get().matches("[0-9a-f]{40}");
}
/** Synthetic key to link to within the database */
public static class Id extends IntKey<com.google.gwtorm.client.Key<?>> {
private static final long serialVersionUID = 1L;