Auth is a new module from the creator of the popular Rights module for managing user permissions in Yii applications. It's a completely new, modern and responsive user interface for Yii's authorization manager (CAuthManager) built using the also popular Bootstrap extension.
Auth is NOT a new version of Rights, even though those familiar with Rights might feel at home using it. It was developed from scratch following Yii's conventions and it's both easier to use and extend.
Links ¶
Requirements ¶
Usage ¶
You can read about how to setup and use this module from its README on GitHub.
Changes ¶
v1.6.0 (Jan 23, 2013) ¶
- Moved admins to AuthBehavior
- Change AuthFilter to require login
- Translation fixes
v1.5.0 (Jan 17, 2013) ¶
- Change module to only allow admin users
- Rename translations (e.g. en_us to en)
- Translation fixes
v1.4.1 (Jan 12, 2013) ¶
- Fix caching of access checks
- Add Russian translation (thanks Ragazzo)
v1.4.0 (Jan 12, 2013) ¶
- Add support for caching access checks
- Add initial support for CPhpAuthManager
- Fix capitalization for cyrillic languages
- Ukranian translation (thanks MadAnd)
v1.3.0 (Jan 4, 2013) ¶
- Added support for bypassing access checks for certain users
- Fixed controller ids when translations are enabled
v1.2.1 (Jan 1, 2013) ¶
- Refactored grid column classes
- Fixed a minor bug in listing assignments
v1.2.0 (Dec 31, 2012) ¶
- Added CachedDbAuthManager
- Added authorization item subcontrollers
v1.1.0 (Dec 30, 2012) ¶
- PHP 5.3.0 requirement dropped
- Refactored code
v1.0.0 (Dec 29, 2012) ¶
Total 20 comments
from the github support:
What happen to the github link?
Anybody can suggest me, how could i assign admin permissions to some user with extension.
I am not expecting to add that user into the admins array into the config file. :) it would be great if anybody can tell me some thoughts about it.
Thanks in Advance.
Thanks and Regards,
Thanks for your solution posted in Your text to link here... :)
i have already fixed that issue with your provided solution few days before. but couldn't reply on the thread.
Anyways thanks again for your response.
Fixed with:
Hi first of all, thanks for the extension. It's really useful, although I dont know how to set owner validation into the yii-auth logic
I always use the below code of validation, it's not a good piece of code because it does not allow the separation of cross-cutting logic.
please, What is the best way to fulfill my expectations? thanks SERGIO
Hey,
i have downloaded yii-auth-1.6.0.zip version of this extension. and done configuration as you have mentioned here.
But when i am trying to access the application i am getting below given exception.
"Property "AuthWebUser.admins" is not defined. "
Any thoughts about it.
Then i temporary commented below given code.
'user' => array( 'class' => 'auth.components.AuthWebUser', //'admins' => array('admin', 'foo', 'bar'), // users with full access ),
And run the app. now its working.
But i am unable to access the magic of this extension yet.Its showing permission error.
Could you please tell me how could i fix it.
And also. in you downloaded extension AuthModule.php is not updated as it is shown here Could you please confirm it.
Looking forward to here from you.
Any operations named module.* are ignored by this module. In order to fix this the auth/filters/AuthFilter.php file should be altered as follows:
Awesome extension.
I have strucked in the admin login page that the captcha not showing the image
after i add $publicPages in beforeControllerAction in admin module AdminModule.php
Working fine
Hi,
I need in system authorise by 'id' of user. Not 'name' column.
In AuthWebUser.php in your module you have "$this->setIsAdmin(in_array($this->id, Yii::app()->authManager->admins));".
I have to all the time when i get update change this to "$this->id".
Is it possible to do something with that?
Answering my own question. I forgot to assign username in UserIdentity class:
AuthWebUser class uses it to assign an admin role. Kind of obvious thing but still I forgot about it while testing.
I can't get it work with assigning user full access. In config I have this:
but when I log in and check with:
it gives me false and denies from actions untill I write them in filters explicitly. Has anyone faced a similar issue before?
1) To display the access errors in the view, you need to add error handler (site/error) to the exclusion of filter or add it to role permissions
2) instead 401 error (Unauthorized) in AuthFilter.php, you need to use 403 (Forbidden)
PS: Chris, thx for perfect extension
There is no allowedActions in the auth extension. Include them in the filters, which are interpreted by the Yii CController.
Read more in the doc.
Is there a way to specify allowed actions for guest user? Like we did with the great Rights Module.
Thank you for this great extension. Not sure why there is no support for setting business rules on operations. I added this functionality, feel free to download the fork: https://github.com/kakousis/yii-auth
Hi Chris,
I've got a lot of auth items:
I've noticed that loading the assignment page took very long and made more than 2000 database queries. So I've written an overloaded CDbAuthManager class that will load everything in one (three actually) queries and serve data from a tree like array.
Check it out at SingleDbAuthManager. If that idea will prove itself, maybe it's worth distributing with your auth module.
When using with auth module, just do:
It shouldn't have any drawbacks in my opinion.
Hi Chris,
Can we use auth without user management/minimum user table? I am a bit confuse.
Does anyone know, if the extension would the extension be compatible with yii-user if it implements this method?
@schmunk Yii::app()->user->isAdmin
Leave a comment
Please login to leave your comment.