Documentation

ConsensusStrategy
in package
implements AccessDecisionStrategyInterface, Stringable

FinalYes

Grants access if there is consensus of granted against denied responses.

Consensus means majority-rule (ignoring abstains) rather than unanimous agreement (ignoring abstains). If you require unanimity, see UnanimousBased.

If there were an equal number of grant and deny votes, the decision will be based on the allowIfEqualGrantedDeniedDecisions property value (defaults to true).

If all voters abstained from voting, the decision will be based on the allowIfAllAbstainDecisions property value (defaults to false).

Tags
author

Fabien Potencier fabien@symfony.com

author

Alexander M. Turek me@derrabus.de

Table of Contents

Interfaces

AccessDecisionStrategyInterface
A strategy for turning a stream of votes into a final decision.
Stringable

Properties

$allowIfAllAbstainDecisions  : bool
$allowIfEqualGrantedDeniedDecisions  : bool

Methods

__construct()  : mixed
__toString()  : string
decide()  : bool

Properties

$allowIfEqualGrantedDeniedDecisions

private bool $allowIfEqualGrantedDeniedDecisions

Methods

__construct()

public __construct([bool $allowIfAllAbstainDecisions = false ][, bool $allowIfEqualGrantedDeniedDecisions = true ]) : mixed
Parameters
$allowIfAllAbstainDecisions : bool = false
$allowIfEqualGrantedDeniedDecisions : bool = true

decide()

public decide(Traversable $results) : bool
Parameters
$results : Traversable
Return values
bool

        
On this page

Search results