Difference between #10 and #17 of
Installing Yii Users and Rights to Newly Created Yii app

Revision #17 has been created by Rajith R on Feb 4, 2014, 5:39:29 AM with the memo:

mistake
« previous (#10) next (#18) »

Changes

Title unchanged

Installing Yii Users and Rights to Newly Created Yii app

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

yii user, right, user, Authentication, access control, rights, Role based access control

Content changed

[...]
Create tables for user module
-----------------------------

then goto /protected/modules/user/data/schema.mysql.sql
** 
 
Need to update schema.mysql.sql to create field `lastvisit_at` instead of `lastvisit`

open the sql file ,and create the tables manually(that i prefer) , remove the 'tbl_' prefix from the tables(i prefer)
[...]
```php
$this->widget('zii.widgets.CMenu',array(
            'items'=>array(                 array('label'=>Yii::t('app','Home'), 'url'=>array('/site/index')), array('label'=>Yii::t('app','About'), 'url'=>array('/site/page', 'view'=>'about')), array('label'=>Yii::t('app','Contact'), 'url'=>array('/site/contact')),                 array('label'=>Yii::t('app','Login'), 'url'=>array('/user/login'),
 
         
'visible'=>Yii::app()->user->isGuest),
 
       array('label'=>Yii::t('app','Rights'), 'url'=>array('/rights')),  'visible'=>Yii::app()->user->isGuest),
 
array('label'=>
               array('label'=>Yii::t('app','Logout').' ('.Yii::app()->user->name.')', 'url'=>array('/user/logout'), 'visible'=>!Yii::app()->user->isGuest) ),
 
));
 
```
 
 
 
 
 
 
 
            ,
 
        )));
 
```
 
 
 
 
 
Add rights 
 
----------
 
 
Then add rights filter to all controller
 
 
like
 
 
 
 
 
```php 
public function filters()
 
{
 
return array(
 
'rights', // perform access control for CRUD operations
 

 
);
 
}
 
```
 
 
and change the extended controller to 'extends RController'.
 
 
then take rights in your url(according to url style) . 
 
 
 
continue
 
------------------
 
 
[http://www.yiiframework.com/wiki/448/assigning-dynamic-roles-to-a-user-using-yii-rights-module-at-the-time-of-user-creation-and-using-some-special-features-of-yii-rights/](http://www.yiiframework.com/wiki/448/assigning-dynamic-roles-to-a-user-using-yii-rights-module-at-the-time-of-user-creation-and-using-some-special-features-of-yii-rights/ "continue")
11 1
40 followers
Viewed: 108 952 times
Version: 1.1
Category: Tutorials
Written by: Rajith R
Last updated by: Rajith R
Created on: Nov 27, 2012
Last updated: 10 years ago
Update Article

Revisions

View all history