Rename RBAC Tables?

Is it possible to rename the RBAC tables to lowercase? So they fit more in my own naming conventions :P

Sure you can. You can give RBAC tables any name you want, just need to tell those names in your config.

For example part of my protected/config/main.php:




return array(

...

	'components' => array(

...

		'authManager'=>array(

			'class'=>'CDbAuthManager',

			'itemTable'=>'authitem',

			'assignmentTable'=>'authassignment',

			'itemChildTable'=>'authitemchild',

		),

...

	),

...

);



awesome thx :)

Very helpful, thanks

Uh, you can do better than that:




'components'=>array(

  ...,

  'authManager'=>array(

    'class'=>'CDbAuthManager',

    'itemTable'=>'{{auth_item}}',

    'assignmentTable'=>'{{auth_assignment}}',

    'itemChildTable'=>'{{auth_item_child}}',

  ),

),



That way it’ll blend in more with the rest of your table naming conventions (why the defaults use camel case is beyond me) and will also pick up table prefixes.

Nice! but beware that you can’t just rename the tables in phpmyadmin due to foreign key constraints on the AuthItem table. Best done by editing the sql for the schema in web/auth/schema-* at the start. If you do rename these after the fact, remember to also update the table names within any models you’ve made with these.