Abstract Class humhub\components\access\ActionAccessValidator

Inheritancehumhub\components\access\ActionAccessValidator » humhub\components\access\AccessValidator » yii\base\BaseObject
Subclasseshumhub\components\access\DelegateAccessValidator, humhub\components\access\DeprecatedPermissionAccessValidator, humhub\components\access\PermissionAccessValidator, humhub\modules\content\components\ContentContainerPermissionAccess, humhub\modules\content\components\UserGroupAccessValidator

This Validator filters out non action related rules and supports a $strict mode, which will require all validator related rules to pass.

If $strict mode is set to false only one of the validator related rules have pass.

Subclasses of ActionAccessValidator only have to extend the validate() function for validating a single rule.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$access humhub\components\access\ControllerAccess Access instance humhub\components\access\AccessValidator
$actionFilter boolean Determines if this validator is only interested in action related rules or all validator related rules humhub\components\access\AccessValidator
$code integer Http error code used in case the validation failes humhub\components\access\AccessValidator
$name string The name of the valdiator humhub\components\access\AccessValidator
$reason string Validator error message humhub\components\access\AccessValidator
$strict boolean If set to true (default) all validator related rules have to pass otherwise only one humhub\components\access\ActionAccessValidator

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
extractActions() Extracts actions settings form a given rule. humhub\components\access\AccessValidator
filterRelatedRules() Filters out rules not related to the current validator and action. humhub\components\access\ActionAccessValidator
getRuleName() Extracts the ruleName from the given array. humhub\components\access\AccessValidator
isActionRelated() Checks if the current action is contained in the given $rule. humhub\components\access\AccessValidator
validate() humhub\components\access\ActionAccessValidator

Property Details

$strict public property

If set to true (default) all validator related rules have to pass otherwise only one

public boolean $strict true

Method Details

filterRelatedRules() protected method

Filters out rules not related to the current validator and action.

protected array filterRelatedRules ( $rules null )
$rules array|null
run() public method

Runs the validation against all validator and action related rules.

This function will return true, if there is no action related rule for this validator.

public boolean run ( )
validate() protected abstract method

protected abstract void validate ( $rule )
$rule