Class humhub\components\access\StrictAccess

Inheritancehumhub\components\access\StrictAccess » humhub\components\access\ControllerAccess » yii\base\BaseObject

StrictAccess should be used by all controllers which don't allow guest access if guest mode is inactive.

There are only some controllers which require guest access even if guest mode is not active as Login, Registration etc.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$action string The controller action id to test humhub\components\access\ControllerAccess
$code integer Http code, can be changed in verify checks for specific error codes humhub\components\access\ControllerAccess
$owner \yii\web\Controller Owner object of this ControllerAccess the owner is mainly used to find custom validation handler humhub\components\access\ControllerAccess
$reason string Actual decline message, can be changed in verify checks for specific error messages humhub\components\access\ControllerAccess
$user humhub\modules\user\models\User Identity to test against humhub\components\access\ControllerAccess

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$fixedRules array Fixed rules will always be added to the current rule set humhub\components\access\ControllerAccess
$rules array Access rule array humhub\components\access\ControllerAccess
$validators array Defines all available validators, this list can be extended by calling registerValidator() humhub\components\access\ControllerAccess

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
findValidator() humhub\components\access\ControllerAccess
getCustomValidator() humhub\components\access\ControllerAccess
getName() Extracts the ruleName from a given rule option array. humhub\components\access\ControllerAccess
registerValidator() Adds a new validator to the available validators and sets some default values. humhub\components\access\ControllerAccess


Hide inherited constants

ConstantValueDescriptionDefined By
ACTION_SETTING_TYPE_BOTH 1 Allows the action rule setting by extra option ['myRule', 'actions' => ['action1', 'action2']] or immediate ['myRule' => ['action1', 'action2']] humhub\components\access\ControllerAccess
ACTION_SETTING_TYPE_OPTION_ONLY 0 Allows the action rule setting only by extra option ['myRule', 'actions' => ['action1', 'action2']] humhub\components\access\ControllerAccess
RULE_ADMIN_ONLY 'admin' Only admins have access to the given set of actions e.g.: ['admin' => ['action1']] humhub\components\access\ControllerAccess
RULE_DISABLED_USER 'disabledUser' Check guest if user is disabled humhub\components\access\ControllerAccess
RULE_JSON 'json' Make sure response type is json humhub\components\access\ControllerAccess
RULE_LOGGED_IN_ONLY 'login' Only logged in user have access e.g.: ['login' => ['action1', 'action2']] humhub\components\access\ControllerAccess
RULE_PERMISSION 'permission' Validate against a given set of permissions e.g.: ['permission' => [MyPermission::class], 'actions' => ['action1']] humhub\components\access\ControllerAccess
RULE_POST 'post' Check guest if request method is post humhub\components\access\ControllerAccess
RULE_STRICT 'strict' Check guest mode e.g.: ['strict'] (mainly used as global) humhub\components\access\ControllerAccess
RULE_UNAPPROVED_USER 'unapprovedUser' Check guest if user is unnapproved humhub\components\access\ControllerAccess

Method Details

getFixedRules() public method

public void getFixedRules ( )