Skip to content

PermissionExpressionParser class

namespace: Serenity.Services   assembly: Serenity.Net.Core

Parses and evaluates logical permission expressions containing !, &, |, and parentheses.

public static class PermissionExpressionParser

Public Members

name description
static Evaluate(…) Evaluates tokens in Reverse Polish Notation produced by ShuntingYard.
static HasPermission(…) Checks a permission that may be a logical expression. A single permission key is passed to hasPermissionKey as is, while for an expression, each permission key in it is passed separately and the results are combined with the operators.
static IsExpression(…) Returns true if the permission is a logical expression, e.g. contains !, &, | or parentheses, rather than a single permission key.
static ShuntingYard(…) Converts tokens to Reverse Polish Notation using the shunting-yard algorithm.
static Tokenize(…) Tokenizes a permission expression into individual operators, parentheses, and permission keys.

See Also