UserFrosting API

AccessConditionExpression

AccessConditionExpression class.

This class models the evaluation of an authorization condition expression, as associated with permissions. A condition is built as a boolean expression composed of AccessCondition method calls.

Tags
author

Alex Weissman (https://alexanderweissman.com)

Table of Contents

$user UserInterface
$nodeVisitor ParserNodeFunctionEvaluator
$parser Parser
$traverser NodeTraverser
$prettyPrinter Standard
$logger Logger
$debug bool
__construct() Create a new AccessConditionExpression object. mixed
evaluateCondition() Evaluates a condition expression, based on the given parameters. bool

Properties

Methods

__construct()

Create a new AccessConditionExpression object.

public __construct( $nodeVisitor : ParserNodeFunctionEvaluator , $user : UserInterface , $logger : Logger [, $debug : bool = false ] ) : mixed
Parameters
$nodeVisitor : ParserNodeFunctionEvaluator
$user : UserInterface

A user object, which for convenience can be referenced as 'self' in access conditions.

$logger : Logger

A Monolog logger, used to dump debugging info for authorization evaluations.

$debug : bool = false

Set to true if you want debugging information printed to the auth log.

Return values
mixed

evaluateCondition()

Evaluates a condition expression, based on the given parameters.

public evaluateCondition( $condition : string , $params : mixed ) : bool

The special parameter self is an array of the current user's data. This get included automatically, and so does not need to be passed in.

Parameters
$condition : string

a boolean expression composed of calls to AccessCondition functions.

$params : mixed
Return values
bool

true if the condition is passed for the given parameters, otherwise returns false.

Search results