Domanda

I just uploaded my website to the cloud. It was working fine on localhost. But it gives me this error in views containing RBAC. I'm not sure why (see code).

I tried changing the model permissions from 644 to 777 for AuthAssignment model to see if that helped. It did not.

The error comes when YII tries to run the "CheckAccess" code in my controller. Error is shown in Line 220 of the code below.

Does anyone know whats going on and what I can do to fix it? Thanks!

CException

Property "CDbAuthManager.AuthAssignment" is read only.
/var/www/vhosts/MYDOMAIN/yii/framework/YiiBase.php(220)

  208             {
  209                 unset($args[0]);
  210                 $class=new ReflectionClass($type);
  211                 // Note: ReflectionClass::newInstanceArgs() is available for PHP        5.1.3+
  212                 // $object=$class->newInstanceArgs($args);
  213                 $object=call_user_func_array(array($class,'newInstance'),$args);
  214             }
  215         }
  216         else
  217             $object=new $type;
  218 
  219         foreach($config as $key=>$value)
  220             $object->$key=$value;
  221 
  222         return $object;
  223     }
  224 
  225     /**
  226      * Imports a class or a directory.
  227      *
  228      * Importing a class is like including the corresponding class file.
  229      * The main difference is that importing a class is much lighter because it only
  230      * includes the class file when the class is referenced the first time.
  231      *
  232      * Importing a directory is equivalent to adding a directory into the PHP include path.
È stato utile?

Soluzione

Figured this out. This was a silly mistake. I was trying to solve the issue of RBAC table assignment after uploading to a linux server, and did that wrong. This is the correct way.

//In config/main.php

'authManager'=>array(
        'class'=>'CDbAuthManager',
        'connectionID'=>'db',
        'assignmentTable'=>'authassignment',
        'itemTable'=>'authitem',
        'itemChildTable'=>'authitemchild',
        ),
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top