mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Updating CrudAuthorize to work like ActionsAuthorize.
Updating tests. Fixes #1749
This commit is contained in:
parent
2a554237f4
commit
a5fe702624
2 changed files with 4 additions and 3 deletions
|
@ -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']]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue