Yii Framework Forum: [solved]error403 checkaccess yii rights - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[solved]error403 checkaccess yii rights Rate Topic: -----

#1 User is offline   xent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 14-November 10

Posted 01 March 2012 - 10:50 PM

Hallo bro/sist mau nanya cara implementasi Checkaccess dengan Rights

codenya di http://pastebin.com/nwKfDGi8

kenapa ya selalu muncul error 403 saat non superuser akses
padalah udah dikasi
'return yii::app()->user->id==$params['userid'];'
di database

+-----------------------+-----+-------------------+---------------------------------------------------+-----+ 
|Profile.ChangePassword	|  0  |  Change password  | 'return yii::app()->user->id==$params['userid'];' |  N; |
+-----------------------+-----+-------------------+---------------------------------------------------+-----+


ataukah implementasi kodenya salah? mohon petunjuknya. trims
xent

My first app: School Information System
Find error? Post here
My Blog
0

#2 User is offline   xent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 14-November 10

Posted 05 March 2012 - 10:13 PM

Thx to locomo, Problem solved
xent

My first app: School Information System
Find error? Post here
My Blog
0

#3 User is offline   seraphiel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 28-January 12

Posted 29 May 2012 - 11:09 AM

boss.. tanya dong.. gimana caranya benerin error 403 di rights.. aku error 403, There must be at least one superuser!..
tolong bantuannya.. kalau bisa penjelasan detail dong.. soalnya aku masih newbie.. thx
0

#4 User is offline   J.J 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 01-April 11

Posted 30 May 2012 - 01:03 PM

View Postseraphiel, on 29 May 2012 - 11:09 AM, said:

boss.. tanya dong.. gimana caranya benerin error 403 di rights.. aku error 403, There must be at least one superuser!..
tolong bantuannya.. kalau bisa penjelasan detail dong.. soalnya aku masih newbie.. thx

Coba dicek lagi gan, step by step nya spt ini bukan:
  • Pastikan udah bisa login dengan menggunakan data yg ada di tabel user
  • Coba cek di config/main.php, tambahkan spt ini :
    'import'=>array(
        ...
        'application.modules.rights.*',
        'application.modules.rights.components.*',
        ...
    ),
    
    'components'=>array(
        'user'=>array(
            ...
            'class'=>'RWebUser',
        ),
        'authManager'=>array(
            'class'=>'RDbAuthManager',
            'defaultRoles'=>'Guest',
        ),
    ),
    'modules'=>array(
    ...
        'rights' => array(
                      'install' => true,
                      'userClass' => 'User',
                      'userIdColumn' => 'id',
                ),
    ...
    ),
    

  • Pada bagian Components/Controller.php, ubah extends dari CController menjadi RController, dan pada bagian bawah beri tambahan
    public function filters() {
                return array(
                    'Rights',
                );
            }
            
            public function allowedActions() {
                return '*';
            }
    

  • Seharusnya jika cara2 diatas telah dijalankan dengan benar, error 403 sudah tidak muncul lagi gan.

Jika mau tau lebih detailnya, dapat membaca file dokumentasi yg disertakan ketika anda mendownload Rights. Selamat mencoba dan semoga sukses.. :)
1

#5 User is offline   ahmadroni 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 250
  • Joined: 14-June 09
  • Location:Yogyakarta-Indonesia

Posted 15 June 2012 - 09:17 PM

mantap gan... ane juga baru belajar .. ada TS ini ane jadi tambah ilmunya
Hospital Cost Management System and
Hospital Management Information System
0

#6 User is offline   J.J 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 01-April 11

Posted 22 June 2012 - 11:08 AM

View Postahmadroni, on 15 June 2012 - 09:17 PM, said:

mantap gan... ane juga baru belajar .. ada TS ini ane jadi tambah ilmunya


Siappp gan.. ane juga msh perlu belajar banyak gan.. sama2 belajar gan.. ::)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users