Create one module "Admin" in "plugins / Admin" tinyauth not work on my module admin.
My AppController in module Admin - > plugin / Admin
Error Users are not associated with Roles the relationship are correct
public function initialize () {
parent :: initialize ();
$ this-> loadComponent ('RequestHandler'); $ this- > loadComponent ('Flash'); $ this-> loadComponent ('TinyAuth.AuthUser'); $ this-> loadComponent ('Auth', [ 'loginAction' = > [ 'controller' = > 'Users', 'action' = > 'Login', 'plugin' = > 'Admin' ], 'loginRedirect' = > [ 'controller' = > 'Users', 'action' = > 'index' ], 'authError' = > 'Did you really think you were allowed to see that?', 'authenticate' = > [ 'Form' = > [ 'fields' = > [ 'username' = > 'email', 'password' = > 'password' ], 'scope' = > ['Users.active' = > true], 'contain' = > ['Roles'],
]
],
'authorize' => [
'TinyAuth.Tiny' => [
'roleColumn' => 'role_id',
'rolesTable' => 'Roles',
'multiRole' => true,
'pivotTable' => 'roles_users',
'superAdminRole' => null,
'authorizeByPrefix' => false,
'prefixes' => [],
'allowUser' => false,
'adminPrefix' => null,
'autoClearCache' => true
]
]
]
); }
}