refactor: move single-quote normalization to EnforceView.CreateWithMatcher Co-authored-by: sagilio <42855245+sagilio@users.noreply.github.com>
diff --git a/Casbin/EnforceView.cs b/Casbin/EnforceView.cs index 74a1cce..0d5bb33 100644 --- a/Casbin/EnforceView.cs +++ b/Casbin/EnforceView.cs
@@ -59,6 +59,7 @@ string policyType = PermConstants.DefaultPolicyType, string effectType = PermConstants.DefaultPolicyEffectType) { + matcher = matcher.Replace('\'', '"'); IReadOnlyAssertion requestAssertion = model.Sections.GetRequestAssertion(requestType); PolicyAssertion policyAssertion = model.Sections.GetPolicyAssertion(policyType); IReadOnlyAssertion effectAssertion = model.Sections.GetPolicyEffectAssertion(effectType);
diff --git a/Casbin/Evaluation/ExpressionHandler.cs b/Casbin/Evaluation/ExpressionHandler.cs index c0a0946..37ed65d 100644 --- a/Casbin/Evaluation/ExpressionHandler.cs +++ b/Casbin/Evaluation/ExpressionHandler.cs
@@ -72,7 +72,6 @@ where TRequest : IRequestValues where TPolicy : IPolicyValues { - expressionString = expressionString.Replace('\'', '"'); if (context.View.SupportGeneric is false) { if (_cachePool.TryGetFunc(expressionString,