Fix visibility of the method Controller::getAccessRules() (#6635)

* Fix visibility of the method `Controller::getAccessRules()`

* Update php-test.yml

---------

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Yuriy Bakhtin 2023-10-28 14:06:21 +02:00 committed by GitHub
parent 04937ececb
commit 225f5da4b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 72 additions and 62 deletions

View File

@ -57,7 +57,7 @@ jobs:
steps:
- name: Start Selenium
run: |
docker run --detach --net=host --shm-size="2g" selenium/standalone-chrome
docker run --detach --net=host --shm-size="2g" selenium/standalone-chrome:117.0-20230926
- uses: actions/checkout@v2
- uses: actions/setup-node@v1

View File

@ -9,6 +9,7 @@ HumHub Changelog
- Fix #6615: Improve scrolling to anchor with fixed header
- Fix #6629: Fix visibility of new message counter on space chooser
- Fix #6630: Fix visibility of top sorted stream entries on dashboard from external filters
- Fix #6635: Fix visibility of the method `Controller::getAccessRules()`
1.14.4 (September 20, 2023)
---------------------------

View File

@ -24,7 +24,7 @@ use yii\web\HttpException;
* Disable guest access for all controller actions:
*
* ```php
* public function getAccessRules()
* protected function getAccessRules()
* {
* return [
* ['login']
@ -35,7 +35,7 @@ use yii\web\HttpException;
* Disable guest access for specific controller actions:
*
* ```php
* public function getAccessRules()
* protected function getAccessRules()
* {
* return [
* ['login' => ['action1', 'action2']]
@ -46,7 +46,7 @@ use yii\web\HttpException;
* All users have to be logged in + additional permission check for 'action1' and 'action2':
*
* ```php
* public function getAccessRules()
* protected function getAccessRules()
* {
* return [
* ['login'],
@ -58,7 +58,7 @@ use yii\web\HttpException;
* Custom inline validator for action 'action1':
*
* ```php
* public function getAccessRules()
* protected function getAccessRules()
* {
* return [
* ['validateMyCustomRule', 'someParameter' => 'someValue', 'actions' => ['action1']]

View File

@ -22,7 +22,7 @@ class OembedController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [['login']];
}

View File

@ -25,7 +25,7 @@ class AdminController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageSettings::class],

View File

@ -39,13 +39,13 @@ class ApprovalController extends Controller
{
$this->subLayout = '@admin/views/layouts/user';
$this->appendPageTitle(Yii::t('AdminModule.base', 'Approval'));
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY],

View File

@ -38,13 +38,13 @@ class AuthenticationController extends Controller
$this->subLayout = '@admin/views/layouts/user';
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageSettings::class]

View File

@ -42,13 +42,13 @@ class GroupController extends Controller
$this->subLayout = '@admin/views/layouts/user';
$this->appendPageTitle(Yii::t('AdminModule.base', 'Groups'));
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageGroups::class],

View File

@ -37,16 +37,19 @@ class InformationController extends Controller
*/
public $defaultAction = 'about';
/**
* @inheritdoc
*/
public function init()
{
$this->subLayout = '@admin/views/layouts/information';
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => \humhub\modules\admin\permissions\SeeAdminInformation::class],

View File

@ -32,13 +32,13 @@ class LoggingController extends Controller
$this->appendPageTitle(Yii::t('AdminModule.base', 'Logging'));
$this->subLayout = '@admin/views/layouts/information';
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => SeeAdminInformation::class]

View File

@ -43,13 +43,13 @@ class ModuleController extends Controller
{
$this->appendPageTitle(Yii::t('AdminModule.base', 'Modules'));
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageModules::class]

View File

@ -34,7 +34,7 @@ class PendingRegistrationsController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[

View File

@ -28,7 +28,6 @@ use humhub\models\UrlOembed;
use humhub\modules\admin\components\Controller;
use humhub\modules\admin\models\Log;
use humhub\modules\notification\models\forms\NotificationSettings;
use yii\base\BaseObject;
/**
* SettingController
@ -65,13 +64,13 @@ class SettingController extends Controller
]);
$this->subLayout = '@admin/views/layouts/setting';
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageSettings::class]

View File

@ -41,13 +41,13 @@ class SpaceController extends Controller
$this->subLayout = '@admin/views/layouts/space';
$this->appendPageTitle(Yii::t('AdminModule.base', 'Spaces'));
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => [ManageSpaces::class, ManageSettings::class]],

View File

@ -55,7 +55,7 @@ class UserController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => [ManageUsers::class, ManageGroups::class]],

View File

@ -40,7 +40,7 @@ class UserPeopleController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => [ManageSettings::class]]

View File

@ -11,13 +11,10 @@ use humhub\modules\admin\components\Controller;
use humhub\modules\admin\permissions\ManageSettings;
use humhub\modules\admin\permissions\ManageUsers;
use humhub\modules\content\components\ContentContainerDefaultPermissionManager;
use humhub\modules\content\models\ContentContainerDefaultPermission;
use humhub\modules\content\models\ContentContainerPermission;
use humhub\modules\content\models\ContentContainerSetting;
use humhub\modules\user\models\User;
use humhub\modules\user\Module;
use Yii;
use yii\db\Expression;
use yii\web\HttpException;
/**
@ -47,7 +44,7 @@ class UserPermissionsController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => [ManageUsers::class]],

View File

@ -39,13 +39,13 @@ class UserProfileController extends Controller
$this->appendPageTitle(Yii::t('AdminModule.base', 'Userprofiles'));
$this->subLayout = '@admin/views/layouts/user';
return parent::init();
parent::init();
}
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageUsers::class]

View File

@ -39,9 +39,9 @@ use yii\web\NotFoundHttpException;
class CommentController extends Controller
{
/**
* @return array
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY => ['post', 'edit', 'delete']],

View File

@ -31,7 +31,7 @@ class FileController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY => ['upload', 'delete']]

View File

@ -24,7 +24,7 @@ class BrowseController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageModules::class]

View File

@ -30,7 +30,7 @@ class PurchaseController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageModules::class]

View File

@ -24,7 +24,7 @@ class UpdateController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageModules::class]

View File

@ -25,7 +25,7 @@ class AdminController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['permissions' => ManageSettings::class],

View File

@ -30,7 +30,7 @@ class EntryController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY]

View File

@ -22,9 +22,9 @@ use yii\db\IntegrityException;
class ListController extends Controller
{
/**
* @inheritDoc
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY]

View File

@ -29,7 +29,7 @@ class OverviewController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY]

View File

@ -10,7 +10,7 @@ namespace humhub\modules\search\controllers;
use humhub\components\Controller;
use humhub\libs\ParameterEvent;
use \humhub\modules\comment\Module as CommentModule;
use humhub\modules\comment\Module as CommentModule;
use humhub\modules\content\components\ContentContainerActiveRecord;
use humhub\modules\content\models\Content;
use humhub\modules\post\models\Post;
@ -45,7 +45,7 @@ class MentioningController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['login']

View File

@ -48,7 +48,7 @@ class SearchController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['login']

View File

@ -36,7 +36,10 @@ use yii\web\HttpException;
*/
class MembershipController extends ContentContainerController
{
public function getAccessRules()
/**
* @inheritdoc
*/
protected function getAccessRules()
{
return [
['permission' => [InviteUsers::class], 'actions' => ['invite']],

View File

@ -21,7 +21,10 @@ class ImageController extends ContainerImageController
{
public $validContentContainerClasses = [Space::class];
public function getAccessRules()
/**
* @inheritdoc
*/
protected function getAccessRules()
{
return [
[ContentContainerControllerAccess::RULE_USER_GROUP_ONLY => [Space::USERGROUP_ADMIN]],

View File

@ -19,7 +19,10 @@ use yii\web\HttpException;
class ManageController extends ContentContainerController
{
public function getAccessRules()
/**
* @inheritdoc
*/
protected function getAccessRules()
{
return [
['login'],

View File

@ -8,13 +8,8 @@
namespace humhub\modules\topic\controllers;
use humhub\modules\content\components\ContentContainerController;
use humhub\modules\content\models\Content;
use humhub\modules\topic\models\forms\ContentTopicsForm;
use humhub\modules\topic\widgets\TopicPicker;
use Yii;
use yii\web\HttpException;
class TopicController extends ContentContainerController
{
@ -26,7 +21,7 @@ class TopicController extends ContentContainerController
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
['json']

View File

@ -9,10 +9,10 @@
namespace humhub\modules\tour\controllers;
use humhub\modules\space\models\Membership;
use humhub\modules\space\models\Space;
use humhub\modules\tour\Module;
use Yii;
use yii\web\HttpException;
use humhub\modules\space\models\Space;
/**
@ -24,7 +24,10 @@ use humhub\modules\space\models\Space;
*/
class TourController extends \humhub\components\Controller
{
public function getAccessRules()
/**
* @inheritdoc
*/
protected function getAccessRules()
{
return [
['login']

View File

@ -28,7 +28,7 @@ class BaseAccountController extends \humhub\components\Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY]
@ -46,7 +46,7 @@ class BaseAccountController extends \humhub\components\Controller
public function init()
{
$this->appendPageTitle(\Yii::t('UserModule.base', 'My Account'));
return parent::init();
parent::init();
}
/**

View File

@ -49,7 +49,10 @@ class ImageController extends ContainerImageController
}
}
public function getAccessRules()
/**
* @inheritdoc
*/
protected function getAccessRules()
{
return [
['validateAccess'],

View File

@ -44,7 +44,7 @@ class PeopleController extends Controller
/**
* @inheritdoc
*/
public function getAccessRules()
protected function getAccessRules()
{
return [
[ControllerAccess::RULE_LOGGED_IN_ONLY],