File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/main/java/org/casbin/jcasbin/util Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -146,14 +146,16 @@ public static String escapeAssertion(String s) {
146146 * @return the 'include' expression.
147147 */
148148 public static String convertInSyntax (String expString ) {
149- Matcher matcher = IN_SYNTAX_PATTERN .matcher (expString );
150- if (matcher .find ()) {
151- StringBuffer sb = new StringBuffer ();
152- do {
153- matcher .appendReplacement (sb , "include($2, $1)" );
154- } while (matcher .find ());
155- matcher .appendTail (sb );
156- return sb .toString ();
149+ if (expString .contains (" in " )) {
150+ Matcher matcher = IN_SYNTAX_PATTERN .matcher (expString );
151+ if (matcher .find ()) {
152+ StringBuffer sb = new StringBuffer ();
153+ do {
154+ matcher .appendReplacement (sb , "include($2, $1)" );
155+ } while (matcher .find ());
156+ matcher .appendTail (sb );
157+ return sb .toString ();
158+ }
157159 }
158160
159161 return expString ;
You can’t perform that action at this time.
0 commit comments