Yii Framework Forum: Yii::app()->User->Checkaccess('controller.action') Is Not Workig - Yii Framework Forum

Jump to content

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

Yii::app()->User->Checkaccess('controller.action') Is Not Workig Yii::app()->user->checkAccess('Controller.Action') is

#1 User is offline   haseeb2k9 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-November 12
  • Location:Pakistan

Posted 09 January 2013 - 08:48 AM

hi all,

iam using Yii-Rights and i want to hide all links on a page depending on authority of user on this links.

for example :

array('label'=>'Assign Tasks', 'url'=>array('/AssignedTask/admin'),'visible'=> Yii::app()->user->checkAccess('AssignedTask.Admin')


but its not working.

tell me how to fix it.

thanks in advance.
0

#2 User is offline   waitforit 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 479
  • Joined: 09-February 11

Posted 09 January 2013 - 11:04 PM

Doesn't checkAccess() take a role as argument?
0

#3 User is offline   haseeb2k9 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-November 12
  • Location:Pakistan

Posted 10 January 2013 - 02:40 AM

View Postwaitforit, on 09 January 2013 - 11:04 PM, said:

Doesn't checkAccess() take a role as argument?


Dear waitforit thanks for reply .

but kindly explain how? i meant to say give some example.

thanks.
0

#4 User is offline   haseeb2k9 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-November 12
  • Location:Pakistan

Posted 11 January 2013 - 08:51 AM

View Posthaseeb2k9, on 10 January 2013 - 02:40 AM, said:

Dear waitforit thanks for reply .

but kindly explain how? i meant to say give some example.

thanks.



[Solved]
Yii::app()->User->Checkaccess('controller.action') is solved.

their is mistake in my UserIdentity Class where i am assigning username in
 private $_id 
instead of user id.
simply replacing username with user id my problem is solve now it work properly.
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