Base for a static organization website

db_acl.php 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?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. * Using the Schema command line utility
  22. * cake schema run create DbAcl
  23. */
  24. class DbAclSchema extends CakeSchema {
  25. /**
  26. * Before event.
  27. *
  28. * @param array $event The event data.
  29. * @return bool Success
  30. */
  31. public function before($event = array()) {
  32. return true;
  33. }
  34. /**
  35. * After event.
  36. *
  37. * @param array $event The event data.
  38. * @return void
  39. */
  40. public function after($event = array()) {
  41. }
  42. /**
  43. * ACO - Access Control Object - Something that is wanted
  44. */
  45. public $acos = array(
  46. 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  47. 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  48. 'model' => array('type' => 'string', 'null' => true),
  49. 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  50. 'alias' => array('type' => 'string', 'null' => true),
  51. 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  52. 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  53. 'indexes' => array(
  54. 'PRIMARY' => array('column' => 'id', 'unique' => 1),
  55. 'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
  56. 'idx_acos_alias' => array('column' => 'alias', 'unique' => 0)
  57. )
  58. );
  59. /**
  60. * ARO - Access Request Object - Something that wants something
  61. */
  62. public $aros = array(
  63. 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  64. 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  65. 'model' => array('type' => 'string', 'null' => true),
  66. 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  67. 'alias' => array('type' => 'string', 'null' => true),
  68. 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  69. 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
  70. 'indexes' => array(
  71. 'PRIMARY' => array('column' => 'id', 'unique' => 1),
  72. 'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
  73. 'idx_aros_alias' => array('column' => 'alias', 'unique' => 0)
  74. )
  75. );
  76. /**
  77. * Used by the Cake::Model:Permission class.
  78. * Checks if the given $aro has access to action $action in $aco.
  79. */
  80. public $aros_acos = array(
  81. 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
  82. 'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
  83. 'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
  84. '_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
  85. '_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
  86. '_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
  87. '_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
  88. 'indexes' => array(
  89. 'PRIMARY' => array('column' => 'id', 'unique' => 1),
  90. 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1),
  91. 'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0)
  92. )
  93. );
  94. }