Yii Framework Forum: Menu Y Roles - Yii Framework Forum

Jump to content

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

Menu Y Roles Rate Topic: -----

#1 User is offline   carpin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 05-December 13

Posted 05 December 2013 - 06:24 PM

hola buenas noches!
alguien sabe como hacer para poner dentro del menu un Yii::app()->user->checkAccess() pero colocar dentro del checkaccess varios soles, o como hacer q un elemento del menu sea visible no unicamente para un rol sino para varios porque el sgte menu me funciona bien

array('label'=>'Barrios', 'visible'=>(!Yii::App()->user->IsGuest && Yii::App()->user->checkAccess('administrador')),

pero tengo varios roles que tienen asingado el controlers barrios
0

#2 User is offline   xavieremv 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 19-September 12

Posted 06 December 2013 - 07:06 AM

Utiliza el OR condicional:

array('label'=>'Barrios', 'visible'=>((!Yii::App()->user->IsGuest) && (Yii::App()->user->checkAccess('administrador') || Yii::App()->user->checkAccess('otroRol') )),

0

#3 User is offline   carpin 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 05-December 13

Posted 06 December 2013 - 02:33 PM

Gracias :)
0

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