Class humhub\modules\content\components\ContentContainerControllerAccess

Inheritancehumhub\modules\content\components\ContentContainerControllerAccess » humhub\components\access\StrictAccess » humhub\components\access\ControllerAccess » yii\base\BaseObject

Class ContentContainerControllerAccess

Adds a container permission check to

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
$contentContainer humhub\modules\content\components\ContentContainerActiveRecord humhub\modules\content\components\ContentContainerControllerAccess
$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

Constants

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_CONTAINER_ACCESS 'containerAccess' humhub\modules\content\components\ContentContainerControllerAccess
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_PROFILE_ONLY 'profile' humhub\modules\content\components\ContentContainerControllerAccess
RULE_SPACE_ONLY 'space' humhub\modules\content\components\ContentContainerControllerAccess
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
RULE_USER_GROUP_ONLY 'userGroup' humhub\modules\content\components\ContentContainerControllerAccess

Property Details

Method Details

init() public method

public void init ( )
isAdmin() public method

public void isAdmin ( )
isProfileController() protected method

protected void isProfileController ( )
isSpaceController() protected method

protected void isSpaceController ( )
validateContainerAccess() public method

public boolean validateContainerAccess ( )
return boolean

Additional ContentContainerActiveRecord specific checks

validateProfileOnlyRule() public method

public boolean validateProfileOnlyRule ( )
return boolean

Verifies 'userOnly' rules

validateSpaceOnlyRule() public method

public boolean validateSpaceOnlyRule ( )
return boolean

Verifies 'spaceOnly' rules