From 0bde6d35f500d0c75ebbd1a07148dbfc72905aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?= Date: Fri, 28 Jan 2011 01:44:04 -0430 Subject: [PATCH] Fixing Acl classes loading for the AclBehavior tests --- lib/Cake/Model/AclNode.php | 132 ------------------ .../cases/libs/model/behaviors/acl.test.php | 5 + 2 files changed, 5 insertions(+), 132 deletions(-) diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php index 2e725ef41..e8107fbf3 100644 --- a/lib/Cake/Model/AclNode.php +++ b/lib/Cake/Model/AclNode.php @@ -184,135 +184,3 @@ class AclNode extends AppModel { return $result; } } - -/** - * Access Control Object - * - * @package cake.libs.model - */ -class Aco extends AclNode { - -/** - * Model name - * - * @var string - * @access public - */ - public $name = 'Aco'; - -/** - * Binds to ARO nodes through permissions settings - * - * @var array - * @access public - */ - public $hasAndBelongsToMany = array('Aro' => array('with' => 'Permission')); -} - -/** - * Action for Access Control Object - * - * @package cake.libs.model - */ -class AcoAction extends AppModel { - -/** - * Model name - * - * @var string - * @access public - */ - public $name = 'AcoAction'; - -/** - * ACO Actions belong to ACOs - * - * @var array - * @access public - */ - public $belongsTo = array('Aco'); -} - -/** - * Access Request Object - * - * @package cake.libs.model - */ -class Aro extends AclNode { - -/** - * Model name - * - * @var string - * @access public - */ - public $name = 'Aro'; - -/** - * AROs are linked to ACOs by means of Permission - * - * @var array - * @access public - */ - public $hasAndBelongsToMany = array('Aco' => array('with' => 'Permission')); -} - -/** - * Permissions linking AROs with ACOs - * - * @package cake.libs.model - */ -class Permission extends AppModel { - -/** - * Model name - * - * @var string - * @access public - */ - public $name = 'Permission'; - -/** - * Explicitly disable in-memory query caching - * - * @var boolean - * @access public - */ - public $cacheQueries = false; - -/** - * Override default table name - * - * @var string - * @access public - */ - public $useTable = 'aros_acos'; - -/** - * Permissions link AROs with ACOs - * - * @var array - * @access public - */ - public $belongsTo = array('Aro', 'Aco'); - -/** - * No behaviors for this model - * - * @var array - * @access public - */ - public $actsAs = null; - -/** - * Constructor, used to tell this model to use the - * database configured for ACL - */ - function __construct() { - $config = Configure::read('Acl.database'); - if (!empty($config)) { - $this->useDbConfig = $config; - } - parent::__construct(); - } -} diff --git a/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php index fc97b74c1..8d1ea6ce3 100644 --- a/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php @@ -18,9 +18,14 @@ * @since CakePHP v 1.2.0.4487 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + App::uses('AclBehavior', 'Model/Behavior'); +App::uses('Aco', 'Model'); +App::uses('Aro', 'Model'); +App::uses('AclNode', 'Model'); App::uses('DbAcl', 'Model'); + /** * Test Person class - self joined model *