1

私は yii 権利拡張機能をインストールしました。インストール後のコードは次のとおりです。インストール後にデータベース テーブルが作成されます。

'modules'=>array(
        // uncomment the following to enable the Gii tool

            'rights'=>array( 
             'superuserName'=>'Admin',   // Name of the role with super user privileges.    
             'authenticatedName'=>'Authenticated',  //// Name of the authenticated user role.
                  'userIdColumn'=>'id',// Name of the user id column in the database.   
                   'userNameColumn'=>'username', //     Name of the user name column in the database.  
                   'enableBizRule'=>true, // Whether to enable authorization item business rules.    
                   'enableBizRuleData'=>false, //Whether to enable data for business rules.   
                         'displayDescription'=>true,  // Whether to use item description instead of name.    '
                          // Key to use for setting success flash messages.  
                            'flashErrorKey'=>'RightsError',  
                            / Key to use for setting error flash messages.    
                          //  'install'=>true,    // Whether to install rights.    
                            'baseUrl'=>'/rights', // Base URL for Rights. Change if module is nested.   
                              'layout'=>'rights.views.layouts.main',  // Layout to use for displaying Rights.    
                              'appLayout'=>'application.views.layouts.main', //Application layout.  
                                 'cssFile'=>'rights.css',   // Style sheet file to use for Rights.    '
                                 'install'=>false,  // Whether to enable installer.
                                        'debug'=>false,
                    ),


        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'1234',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
        ),

    ),

しかし、URLhttp://localhost/rightsTest/index.php/rightsを入力すると、

Error 403
There must be at least one superuser!

私は多くのことを試しましたが、答えを見つけることができませんでした。ご協力いただきありがとうございます。

4

4 に答える 4

1

ID、ユーザー名フィールドを持つユーザー テーブルがあり、そのテーブルに少なくとも 1 つのレコードがあるかどうかを確認する必要があります。権限は、ユーザー テーブルの最初のレコードを管理者ロールとして選択するためです。

于 2013-11-14T07:37:11.630 に答える
1

新しい管理者ユーザーを作成します。データベースには権限モジュールの「ユーザー」テーブルが1つあり、選択した「ユーザー名」、「パスワード」を使用して管理者ユーザーを入力し、「スーパーユーザー」および「ステータス」フィールドの値を1に設定することを忘れないでください.. ..

于 2013-11-14T11:14:57.393 に答える