diff --git a/lib/Cake/Controller/Component/Auth/CrudAuthorize.php b/lib/Cake/Controller/Component/Auth/CrudAuthorize.php index 947cb9b64..12998f0d7 100644 --- a/lib/Cake/Controller/Component/Auth/CrudAuthorize.php +++ b/lib/Cake/Controller/Component/Auth/CrudAuthorize.php @@ -90,6 +90,7 @@ class CrudAuthorize extends BaseAuthorize { ); return false; } + $user = array($this->settings['userModel'] => $user); $Acl = $this->_Collection->load('Acl'); return $Acl->check( $user, @@ -97,4 +98,4 @@ class CrudAuthorize extends BaseAuthorize { $this->settings['actionMap'][$request->params['action']] ); } -} \ No newline at end of file +} diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php index 48e2f7ade..a093e9ccf 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php @@ -86,7 +86,7 @@ class CrudAuthorizeTest extends CakeTestCase { ->with($user, 'Posts', 'read') ->will($this->returnValue(true)); - $this->assertTrue($this->auth->authorize($user, $request)); + $this->assertTrue($this->auth->authorize($user['User'], $request)); } /** @@ -108,7 +108,7 @@ class CrudAuthorizeTest extends CakeTestCase { ->with($user, 'Posts', 'read') ->will($this->returnValue(false)); - $this->assertFalse($this->auth->authorize($user, $request)); + $this->assertFalse($this->auth->authorize($user['User'], $request)); }