Yii Rights And Webshell Module Incompatibility

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…

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.

@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.

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).