Yii Framework Forum: How to change the menus on sidebar of Admin LTE if user has multiple roles? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to change the menus on sidebar of Admin LTE if user has multiple roles?

#1 User is offline   Questions 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 15-October 16

Posted 25 September 2017 - 09:20 AM

I am using Yii2 basic.

I have Employee table and I have assigned Employee model to user application component as follows in config file:

'user' => [
'identityClass' => 'app\models\Employee',
'enableSession' => true,
],

I have also created permissions, roles and assigned roles to employees using RBAC.


When admin assigns a particular employee multiple roles, for eg. roles 'fieldofficer' as well as 'Pastor', then he should see on his sidebar foll menus:

1. My Profile
2. SHGProfile - for role fieldofficer
3. Church Members - for role Pastor


How to accomplish this?
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,418
  • Joined: 16-February 11
  • Location:Japan

Posted 26 September 2017 - 05:53 AM

Construct the menus dynamically according the base-level permissions, I mean, not according to the top-level roles. Access controlling should be done using permissions, not using roles.

BTW, I think we've already discussed the matter in another thread of the forum:
http://www.yiiframew...r-roles-in-yii2

What do you find difficult to accomplish?
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users