Closed moplin closed 6 years ago
I am only hiding the route on route configuration. Any better way?
Hi, @moplin
DefaultController
<?php
namespace backend\controllers;
use yii\filters\AccessControl; use yii2mod\settings\controllers\DefaultController;
class SettingController extends DefaultController { /**
@return array */ public function behaviors(): array { $behaviors = parent::behaviors(); $behaviors['access'] = [ 'class' => AccessControl::class, 'rules' => [ [ 'allow' => true, 'roles' => ['super-admin'], // here you can setup your own role ], ], ];
return $behaviors;
} }
'settings' => [
'class' => 'yii2mod\settings\Module',
'controllerMap' => [
'default' => [
'class' => 'backend\controllers\SettingController', // path to your controller
],
]
],
How do I limit the access to settings just to an RBACK SUPERADMIN??