Yii Framework Forum: Yii Rights And Webshell Module Incompatibility - Yii Framework Forum

Jump to content

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

Yii Rights And Webshell Module Incompatibility Rate Topic: -----

#1 User is offline   frijj2k 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 09-November 09

Posted 20 November 2012 - 04:46 AM

I installed and used the Yii Webshell extension (link) without problems in a project I am working on. I then installed Yii Rights (link), configured it and have it working fine for all my controllers/views. I have now come back to needing to use Webshell for testing console commands on a shared host where I have no SSH access but I cannot access it.

I get a 403 error stating that access is denied which is fine as I don't want anybody but myself to access it but I cannot find anywhere in the documentation where I can allow a module (i.e. webshell) for a particular user.

The Webshell module does appear in the "Rights Generate Items" but has no child items to generate for. I have tried manually setting up a permission for "Webshell" but this hasn't worked either.

Any help guys would be appreciated!

Thanks in advance...
0

#2 User is offline   frijj2k 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 09-November 09

Posted 22 November 2012 - 02:31 PM

Sorry to bump but if anybody has any information on this I would be very grateful. :)
0

#3 User is offline   Wiseon3 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 14-February 11

Posted 23 November 2012 - 05:25 AM

View Postfrijj2k, on 22 November 2012 - 02:31 PM, said:

Sorry to bump but if anybody has any information on this I would be very grateful. :)

First of all check if you allowed your ip to use webshell module, using ipFilter property.
If you want to allow access only to a specific user, do the following:
  • Create a new operation, named Webshell.Default.* with the Business rule return Yii::app()->user->getId() == 1; (replace 1 with the id of the user you want to allow access)
  • In the Permissions tab assign access to a role that the user has (assign to Guest for example, as the other roles inherit from it)


If you don't need to be specific about the user id allowed to access the controller, simply remove the Business Rule.
0

#4 User is offline   frijj2k 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 09-November 09

Posted 26 November 2012 - 07:01 AM

@Wiseon3

Thank you for your response. I have done what you said but I still get the 403 error page.

I have no ipFilter setup, I created the new operation as suggested (with business rule as: return Yii::app()->user->getId() == 1;) and assigned it to my 'authenticated' role. My user ID is 1 so the business rule does evaluate to true)... This didn't work so I tried assigning it to the 'guest' role as well but still no no avail. :(

Is there something else I am missing?
0

#5 User is offline   Wiseon3 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 14-February 11

Posted 26 November 2012 - 07:54 AM

View Postfrijj2k, on 26 November 2012 - 07:01 AM, said:

@Wiseon3

Thank you for your response. I have done what you said but I still get the 403 error page.

I have no ipFilter setup, I created the new operation as suggested (with business rule as: return Yii::app()->user->getId() == 1;) and assigned it to my 'authenticated' role. My user ID is 1 so the business rule does evaluate to true)... This didn't work so I tried assigning it to the 'guest' role as well but still no no avail. :(

Is there something else I am missing?

Do you perhaps have enableBizRule set to false for rights module, in config/main.php?

And one more thing, make sure webshell/controllers/DefaultController.php extends Controller and not CController.
0

#6 User is offline   frijj2k 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 09-November 09

Posted 29 November 2012 - 06:57 PM

View PostWiseon3, on 26 November 2012 - 07:54 AM, said:

Do you perhaps have enableBizRule set to false for rights module, in config/main.php?

And one more thing, make sure webshell/controllers/DefaultController.php extends Controller and not CController.


enableBizRule was commented out though should default to true but I explicitly defined it anyways.

Rights modules default controller did indeed extend CController so I changed it to Controller but still I am getting the 403 error page. :(
0

#7 User is offline   Wiseon3 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 14-February 11

Posted 03 December 2012 - 09:46 AM

View Postfrijj2k, on 29 November 2012 - 06:57 PM, said:

enableBizRule was commented out though should default to true but I explicitly defined it anyways.

Rights modules default controller did indeed extend CController so I changed it to Controller but still I am getting the 403 error page. :(

You misunderstood me. The webshell controller should extend Controller, not the Rights controller (do not modify any rights controllers).
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