I’m trying to use this extension in my webapp but something strange is going on.
First, I got this error: (I’m using YiiDebugToolbar too)
[15-Nov-2010 22:44:47] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 877324 bytes) in C:\Program Files\Zend\Apache2\htdocs\protected\extensions\yiidebugtb\XWebDebugRouter.php on line 219
I really like this toolbar, so I changed memory limit to 100M and now I see what is the problem… I’ve got over 2k sql queries! Like this one: (each the same)
Querying SQL: SELECT name,t1.type,description,t1.bizrule,t1.data,weight
FROM AuthItem t1
LEFT JOIN AuthAssignment t2 ON name=t2.itemname
LEFT JOIN AuthItemWeight t3 ON name=t3.itemname
WHERE t1.type=:type AND userid=:userid
ORDER BY t1.type ASC, weight ASC
There is 2205 users in my database right now, but I hope this is some kind of bug, right?
Actually, there was a bug that caused the logged in user to not be marked as a superuser after having installed Rights and therefore did not have access to see the menu. This has been fixed in the newest revision.
However, you will see the menu if you logout after installing and re-login, because then you will be marked as a superuser. (it’s a state for the logged in web user.)
Please don’t change any files within the module or you’ll have trouble when updating the module.
first af all, many thanks for your extension, it works well.
Except for the problem mentionned above.
I did a fresh install of rights plugin. And even after login out and login in, the menu did not appear for the admin user. This is because ‘rights’ install process does not create all the AuthItem (‘RightsAssignments’, ‘RightsPermissions’, ‘RightsAdministration’ and so on)
Actually that’s not the issue, because checkAccess will always return true if currently logged in user is a superuser. If you don’t see the menu your user is most likely not a superuser, please check the AuthAssignment table in the database.
First, I’ve installed ‘yii-user’ for user management. They were by default two users: demo and admin wich is a superuser.
After that, I’ve installed ‘rights’. Installation proces creates two roles “Admin” and “Authenticated”, and in the AuthAssignment table, user admin is assigned to Admin role …
Chris, I’m sorry but I have another question. See below !
if( !in_array($action->id, $this->_allowedActions) and !in_array('*', $this->_allowedActions) )
because:
I want to have posibility to allow all actions in controller that is nested from controller class with ‘rights’ filter. (Redefining of filters is ugly decision, because I have many usable filters defined in parent class)
in_array() always return boolean, so ===false is redundant