hamednourhani / yii-rights

Automatically exported from code.google.com/p/yii-rights
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Can't use authManager in console commands #66

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Configure rights in config/console.php
2. Create a migration containing a call to 
Yii::app()->getComponent('authManager')
3. Call any method, like addItemChild

What is the expected output? What do you see instead?
Exception: CConsoleApplication and its behaviors do not have a method or 
closure named "getAuthManager". 
(/srv/http/yii/framework/base/CComponent.php:269)
#0 /srv/http/havo/protected/modules/rights/components/RAuthorizer.php(27): 
CComponent->__call('getAuthManager', Array)
#1 /srv/http/havo/protected/modules/rights/components/RAuthorizer.php(27): 
CConsoleApplication->getAuthManager()

What version of the product are you using? On what operating system?
Yii 1.1.8
Rights 1.3.0

Please provide any additional information below.
Replacing getAuthManager() with getComponent('authManager') in 
components/RAuthorizer.php:27 seems to fix the problem

Original issue reported on code.google.com by janek....@gmail.com on 11 Nov 2011 at 10:01

GoogleCodeExporter commented 8 years ago
Thank you i tried the getComponent('authManager') instead getAuthManager() and 
it works fine 
Thank you :)

Original comment by om...@jeeran.com on 21 Nov 2011 at 7:47