pictcode / app / Config / Schema / db_acl.php @ 635eef61
履歴 | 表示 | アノテート | ダウンロード (3.895 KB)
| 1 | 635eef61 | spyder1211 | <?php
|
|---|---|---|---|
| 2 | /**
|
||
| 3 | * This is Acl Schema file
|
||
| 4 | *
|
||
| 5 | * Use it to configure database for ACL
|
||
| 6 | *
|
||
| 7 | * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||
| 8 | * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||
| 9 | *
|
||
| 10 | * Licensed under The MIT License
|
||
| 11 | * For full copyright and license information, please see the LICENSE.txt
|
||
| 12 | * Redistributions of files must retain the above copyright notice.
|
||
| 13 | *
|
||
| 14 | * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||
| 15 | * @link http://cakephp.org CakePHP(tm) Project
|
||
| 16 | * @package app.Config.Schema
|
||
| 17 | * @since CakePHP(tm) v 0.2.9
|
||
| 18 | * @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||
| 19 | */
|
||
| 20 | |||
| 21 | /**
|
||
| 22 | * Using the Schema command line utility
|
||
| 23 | * cake schema run create DbAcl
|
||
| 24 | */
|
||
| 25 | class DbAclSchema extends CakeSchema { |
||
| 26 | |||
| 27 | /**
|
||
| 28 | * Before event.
|
||
| 29 | *
|
||
| 30 | * @param array $event The event data.
|
||
| 31 | * @return bool Success
|
||
| 32 | */
|
||
| 33 | public function before($event = array()) { |
||
| 34 | return true; |
||
| 35 | } |
||
| 36 | |||
| 37 | /**
|
||
| 38 | * After event.
|
||
| 39 | *
|
||
| 40 | * @param array $event The event data.
|
||
| 41 | * @return void
|
||
| 42 | */
|
||
| 43 | public function after($event = array()) { |
||
| 44 | } |
||
| 45 | |||
| 46 | /**
|
||
| 47 | * ACO - Access Control Object - Something that is wanted
|
||
| 48 | */
|
||
| 49 | public $acos = array( |
||
| 50 | 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), |
||
| 51 | 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 52 | 'model' => array('type' => 'string', 'null' => true), |
||
| 53 | 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 54 | 'alias' => array('type' => 'string', 'null' => true), |
||
| 55 | 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 56 | 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 57 | 'indexes' => array( |
||
| 58 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), |
||
| 59 | 'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0), |
||
| 60 | 'idx_acos_alias' => array('column' => 'alias', 'unique' => 0) |
||
| 61 | ) |
||
| 62 | ); |
||
| 63 | |||
| 64 | /**
|
||
| 65 | * ARO - Access Request Object - Something that wants something
|
||
| 66 | */
|
||
| 67 | public $aros = array( |
||
| 68 | 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), |
||
| 69 | 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 70 | 'model' => array('type' => 'string', 'null' => true), |
||
| 71 | 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 72 | 'alias' => array('type' => 'string', 'null' => true), |
||
| 73 | 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 74 | 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10), |
||
| 75 | 'indexes' => array( |
||
| 76 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), |
||
| 77 | 'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0), |
||
| 78 | 'idx_aros_alias' => array('column' => 'alias', 'unique' => 0) |
||
| 79 | ) |
||
| 80 | ); |
||
| 81 | |||
| 82 | /**
|
||
| 83 | * Used by the Cake::Model:Permission class.
|
||
| 84 | * Checks if the given $aro has access to action $action in $aco.
|
||
| 85 | */
|
||
| 86 | public $aros_acos = array( |
||
| 87 | 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'), |
||
| 88 | 'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'), |
||
| 89 | 'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10), |
||
| 90 | '_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), |
||
| 91 | '_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), |
||
| 92 | '_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), |
||
| 93 | '_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), |
||
| 94 | 'indexes' => array( |
||
| 95 | 'PRIMARY' => array('column' => 'id', 'unique' => 1), |
||
| 96 | 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1), |
||
| 97 | 'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0) |
||
| 98 | ) |
||
| 99 | ); |
||
| 100 | |||
| 101 | } |