Auth Extension

Hi, attached is the output of the error I have after installing the extension “auth” developed by Chris83. I specified the parameters for the configuration in the module definition array - I am not clear whether that is correct. I have a CompanyContact table instead of Users and it’s primary key is company_contact_id. I’ve set this as the comments suggest, but it throws an error.


Property "CompanyContact.id" is not defined. 

(see attached file for full stack trace)


'modules'=>array(

'auth' => array(

          'strictMode' => true, // when enabled authorization items cannot be assigned children of the same type.

          'users' => array('admin'), // a list of users who has access to the module.

          'userClass' => 'CompanyContact', // the name of the user model class.

          'userIdColumn' => 'company_contact_id', // the name of the user id column.

          'userNameColumn' => 'username', // the name of the user name column.

          'appLayout' => 'application.views.layouts.main', // the layout used by the module.

          'viewDir' => null, // the path to view files to use with this module.

        ),

)

Hi all, I have solved this by making the following change to the Extension class:

I had to change line 35 in class AuthAssignmentItemsColumn

from:

$assignments = $am->loadAuthAssignments($data->id, false);

to:

$assignments = $am->loadAuthAssignments($data->primaryKey(), false);

in order to use a custom "User" model with a primary key other than the standard "id". Chris83 had implemented this scenario but left this line unchanged.

This issue has been fixed in version 1.2.1. Sorry for the inconvenience.

Many thanks for the fast fix.