2007-11-25 16:01:49 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This is Acl Schema file
|
|
|
|
*
|
|
|
|
* Use it to configure database for ACL
|
|
|
|
*
|
2017-06-10 21:33:55 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
2017-06-10 22:10:52 +00:00
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
2007-11-25 16:01:49 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
2013-02-08 12:22:51 +00:00
|
|
|
* For full copyright and license information, please see the LICENSE.txt
|
2007-11-25 16:01:49 +00:00
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2017-06-10 22:10:52 +00:00
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
2017-06-10 21:33:55 +00:00
|
|
|
* @link https://cakephp.org CakePHP(tm) Project
|
2011-10-14 19:06:36 +00:00
|
|
|
* @package app.Config.Schema
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 0.2.9
|
2017-06-10 22:23:14 +00:00
|
|
|
* @license https://opensource.org/licenses/mit-license.php MIT License
|
2007-11-25 16:01:49 +00:00
|
|
|
*/
|
2011-10-14 19:06:36 +00:00
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
2007-11-25 16:01:49 +00:00
|
|
|
* Using the Schema command line utility
|
|
|
|
* cake schema run create DbAcl
|
|
|
|
*/
|
2007-11-23 19:25:19 +00:00
|
|
|
class DbAclSchema extends CakeSchema {
|
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
|
|
|
* Before event.
|
|
|
|
*
|
|
|
|
* @param array $event The event data.
|
2014-07-05 11:49:50 +00:00
|
|
|
* @return bool Success
|
2014-05-28 03:19:44 +00:00
|
|
|
*/
|
2011-10-14 19:06:36 +00:00
|
|
|
public function before($event = array()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-05-28 03:19:44 +00:00
|
|
|
/**
|
|
|
|
* After event.
|
|
|
|
*
|
|
|
|
* @param array $event The event data.
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-10-14 19:06:36 +00:00
|
|
|
public function after($event = array()) {
|
|
|
|
}
|
|
|
|
|
2014-03-02 03:39:42 +00:00
|
|
|
/**
|
|
|
|
* ACO - Access Control Object - Something that is wanted
|
|
|
|
*/
|
2010-04-04 07:14:14 +00:00
|
|
|
public $acos = array(
|
2012-04-30 23:28:02 +00:00
|
|
|
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
|
|
|
|
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
|
|
|
'model' => array('type' => 'string', 'null' => true),
|
|
|
|
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
|
|
|
'alias' => array('type' => 'string', 'null' => true),
|
|
|
|
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
|
|
|
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
2014-06-20 17:49:02 +00:00
|
|
|
'indexes' => array(
|
2014-07-05 11:49:50 +00:00
|
|
|
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
|
|
|
'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
|
|
|
|
'idx_acos_alias' => array('column' => 'alias', 'unique' => 0)
|
|
|
|
)
|
2012-04-30 23:28:02 +00:00
|
|
|
);
|
2007-11-23 19:25:19 +00:00
|
|
|
|
2014-03-02 03:39:42 +00:00
|
|
|
/**
|
|
|
|
* ARO - Access Request Object - Something that wants something
|
|
|
|
*/
|
2010-04-04 07:14:14 +00:00
|
|
|
public $aros = array(
|
2012-04-30 23:28:02 +00:00
|
|
|
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
|
|
|
|
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
|
|
|
'model' => array('type' => 'string', 'null' => true),
|
|
|
|
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
|
|
|
'alias' => array('type' => 'string', 'null' => true),
|
|
|
|
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
|
|
|
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
2014-06-20 17:49:02 +00:00
|
|
|
'indexes' => array(
|
2014-07-05 11:49:50 +00:00
|
|
|
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
|
|
|
'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
|
|
|
|
'idx_aros_alias' => array('column' => 'alias', 'unique' => 0)
|
|
|
|
)
|
2012-04-30 23:28:02 +00:00
|
|
|
);
|
2007-11-23 19:25:19 +00:00
|
|
|
|
2014-03-02 03:39:42 +00:00
|
|
|
/**
|
|
|
|
* Used by the Cake::Model:Permission class.
|
|
|
|
* Checks if the given $aro has access to action $action in $aco.
|
|
|
|
*/
|
2010-04-04 07:14:14 +00:00
|
|
|
public $aros_acos = array(
|
2012-04-30 23:28:02 +00:00
|
|
|
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
|
|
|
|
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
|
|
|
|
'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
|
|
|
|
'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
|
|
|
'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
|
|
|
'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
|
|
|
'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
2014-06-20 17:49:02 +00:00
|
|
|
'indexes' => array(
|
2014-07-05 11:49:50 +00:00
|
|
|
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
|
|
|
'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1),
|
|
|
|
'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0)
|
|
|
|
)
|
2012-04-30 23:28:02 +00:00
|
|
|
);
|
2007-11-23 19:25:19 +00:00
|
|
|
|
|
|
|
}
|