Yii Framework Forum: Disabling Link - Yii Framework Forum

Jump to content

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

Disabling Link Rate Topic: -----

#1 User is offline   prat 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 124
  • Joined: 13-September 13

Posted 18 September 2013 - 05:25 AM

My question is how to disable a particular for multiple user class. Currently I am doing in the following way in layouts/main.php
array('label'=>'Users', 'url'=>array('/user/index'), 'visible'=>Yii::app()->user->checkAccess('admin'))/*'


But what if I want to allow another class called superadmin then how should I do it?
I can't do it like this
array('label'=>'Users', 'url'=>array('/user/index'), 'visible'=>Yii::app()->user->checkAccess('admin'), 'visible'=>Yii::app()->user->checkAccess('superadmin'))/*

0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,670
  • Joined: 04-March 10
  • Location:UK

Posted 18 September 2013 - 07:15 AM

'visible'=>Yii::app()->user->checkAccess('admin') || Yii::app()->user->checkAccess('superadmin')

0

#3 User is offline   prat 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 124
  • Joined: 13-September 13

Posted 18 September 2013 - 08:15 AM

Thanks for the solution. I had completely forgotten about the or operation.
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