From 14c5f3996a46c1281cb133de439f25492c97530a Mon Sep 17 00:00:00 2001
From: dugan <dugan@localhost>
Date: Wed, 07 Mar 2007 14:56:34 +0000
Subject: [PATCH] These changes are mostly related to restructuring the regular expression patterns to make them more readable by defining constants.
---
opends/src/server/org/opends/server/authorization/dseecompat/Permission.java | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/authorization/dseecompat/Permission.java b/opends/src/server/org/opends/server/authorization/dseecompat/Permission.java
index 2e013c7..f258fca 100644
--- a/opends/src/server/org/opends/server/authorization/dseecompat/Permission.java
+++ b/opends/src/server/org/opends/server/authorization/dseecompat/Permission.java
@@ -29,6 +29,7 @@
import static org.opends.server.messages.MessageHandler.getMessage;
import static org.opends.server.authorization.dseecompat.AciMessages.*;
+import static org.opends.server.authorization.dseecompat.Aci.*;
import java.util.regex.Pattern;
/**
@@ -36,12 +37,30 @@
* of an ACI look like deny(search, write).
*/
public class Permission {
- //the access type (allow,deny)
+
+ /*
+ * The access type (allow,deny) corresponding to the ACI permission value.
+ */
private EnumAccessType accessType = null;
+
+ /*
+ * The rights (search, add, delete, ...) corresponding to the ACI rights
+ * value.
+ */
private int rights;
+
+ /*
+ * Regular expression token representing the separator.
+ */
private static final String separatorToken = ",";
- private static final String rightsRegex =
- "\\s*(\\w+)\\s*(,\\s*(\\w+)\\s*)*";
+
+ /*
+ * Regular expression used to match the ACI rights string.
+ */
+ private static final String rightsRegex = ZERO_OR_MORE_WHITESPACE +
+ WORD_GROUP + ZERO_OR_MORE_WHITESPACE +
+ "(," + ZERO_OR_MORE_WHITESPACE + WORD_GROUP +
+ ZERO_OR_MORE_WHITESPACE + ")*";
/**
* Constructor creating a class representing a permission part of an bind
--
Gitblit v1.10.0