Actually it shouldn’t even be faster but the data do consume a bit less space, which only makes a difference if you have a huge amount of data.
I’d advice you to not use MyISAM because it doesn’t guarantee that your data is stored in a consistent manner. Actually it doesn’t guarantee that your data is stored at all. Remember that MyISAM doesn’t support transactions.
Then there’s also the fact that MyISAM tables can crash and require periodical optimization, which InnoDB tables doesn’t. There’s also less room for performance optimization with MyISAM.
The choice of engine doesn’t matter that much for small projects but from my experience I’d definitely advice you to always use InnoDB.
What you’re saying sounds wierd, I’ve noticed some problems with renaming authorization items and you’re right, the foreign key should take care of this. This is exactly why I don’t like FKs… Please let me know if you can find out more about this problem.
The Rights -table is currently only used for sorting of authorization items. So if you didn’t re-order your items it will be empty (drag & drop in the grid views).
Also, defaultRoles should always be and array, e.g. array(‘Guest’).
about modelController class that extends Controller, the function filters and accessrules inside the class, what the effect with rights module, should I change these instead of using default generated code by gii?
not sure if this is an issue with your code. It’s rather the database, but I have no idea what’s wrong. I tried to change the super user to the user with id = 2. Here is what I got:
The point is that… AuthItem “Admin” exists and… I didn’t change the itemname column at all!
the file RController should be located in folder application.modules.rights.components. To be included, you should add the following lines in your main configuration file (application/protected/config/main.php):
// ...
'import'=>array(
'application.models.*',
'application.components.*',
'application.modules.rights.*', // this line is also needed
'application.modules.rights.components.*', // add this line
),
///etc ...
I’ve a problem with Rights. When I log into application I can navigate normally within menus, but when I go to index.php?r=rights (or any other Rights related page) my main navigation items get the /rights prefix. So for example index.php?r=site/index becomes index.php?r=rights/site/index
I’ve installed Rights and Yii-user and it works fine… BUT…
At first i thought I could avoid modifying the code of an extension to be able to update it later with no problem. But that is not possible. The yii user code must be modified if you want, for example, assign a default role to a freshly registered user or have multiple profiles by roles.
Secondly, I’ve created Authorization items for the user module so no user other then admin is able to see the default list given by index.php/user/ (index action). Without success however this task is assigned to no role ! (So only the admin should see the list, right ?)
Furthermore, I’ve noticed that by seeing the list the user could also click on an item (user name) and go to its detail view !!!
What I did is edit the userController.php (in yii-user) and modify the filter to comply with rights
return array(
'rights',
);
and remove the rule part.
Then there was an improvement, the list was still visible but not the view detail anymore.
So I have two questions :
Is changing the controllers of the user extension the right move or is there another way to achieve default role assignment upon registration ?
Why the user.default.index is still accessible after having
a.Created the tasks related to these action in rights and assigned it to none
b.Modified the userController to integrate ‘rights’ ?
Ok, the problem is solved ! If you plan to use rights with the extension yii-user you MUST change the userController and defaultController of this extension and add this to both of them. Maybe it’s written somewhere already but I haven’t seen it.
public function filters()
{
return array(
'rights',
);
}