mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 577 forks source link

Use yii2-admin with yii2-advanced-template #154

Closed leyestd closed 4 years ago

leyestd commented 9 years ago

What should I pay attention, in which the file configuration

varun7387 commented 9 years ago

You need to be careful where you add the code in the config files

I have currently set it up as follows:-

  1. 'as access' to the backend and frontend config files
  2. 'authManager' to common and console config files
  3. 'module' only to common config

I have tried adding module only to the backend, but for some reason it does not seem to work. So I just add it to common config file. But you have to sure that you add 'as access' to frontend as well to allow only guest pages

I hope this makes sense.

leyestd commented 9 years ago

thanks

gauravparashar12 commented 9 years ago

@varun7387 as i setup the mdm admin module in backend application i cannot see the frontend routes. is it possible to view all the routes of frontend in backend i want to control my frontend from backend .

mdmunir commented 9 years ago

@gauravparashar12 No, its imposible.

gauravparashar12 commented 9 years ago

@mdmunir Is it possible to assign routes to specific users. If, it is. Then please let me know what will be the correct way of doing the same.

mdmunir commented 9 years ago

@gauravparashar12 You also cannot directly assign routes to user. You must create permision, permision has routes, and user has permision.

gauravparashar12 commented 9 years ago

@mdmunir thanks for the solution for specific route to particular user , but I am stucked in a problem where i created half of my controllers in backend and half in frontend but all things can be managed by backend only please provide me the way how i can implement this or is i have to merge all controllers in one application then what is the best way ?

fishlv2 commented 9 years ago

when I add the admin to bootstrap I get the following error:

Unknown bootstrapping component ID: admin

only works when i have

'bootstrap' => ['log'],

any suggestion??

thanks

firefox747 commented 9 years ago

@mdmunir concerning the backend-and-frontend-routes-problem mentioned by @gauravparashar12, how about we implement the solution from this stackoverflow post: https://stackoverflow.com/questions/32777923/get-modules-structure-in-yii2-advanced-template

In short you could get all the modules like this: $config = yii\helpers\ArrayHelper::merge( require(DIR . '/../../../common/config/main.php'), require(DIR . '/../../../common/config/main-local.php'), require(DIR . '/../../../frontend/config/main.php'), require(DIR . '/../../../frontend/config/main-local.php'), require(DIR . '/../../../backend/config/main.php'), require(DIR . '/../../../backend/config/main-local.php') ); $modules = array_keys($config['modules']);

Then use this within your RouteController::getAppRoutes() method to get all routes. $config could be a module property which is customizable for every Yii2 app structure. As a default you could revert to Yii::$app as you currently do.

Cheers

Kai

RGTimothy commented 8 years ago

Hi @firefox747, can you explain the method you mentioned above step by step? Thank you.

firefox747 commented 8 years ago

@RGTimothy sorry for my late reply. Was busy on other things the late months. I have uploaded a possible solution for yii2-admin and yii2-advanced-template. See https://github.com/mdmsoft/yii2-admin/pull/309

leyestd commented 7 years ago

@gauravparashar12 click refresh button because cache

jimmylotus commented 7 years ago

@firefox747 so which file should I edit to add these code? Thank you

sihar commented 4 years ago

I close the issue cause have similarity with #309