Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
15403 manish.sha 1
<?php
2
/**
3
 * This is Acl Schema file
4
 *
5
 * Use it to configure database for ACL
6
 *
7
 * @link          http://cakephp.org CakePHP(tm) Project
8
 * @package       app.Config.Schema
9
 * @since         CakePHP(tm) v 0.2.9
10
 */
11
 
12
/*
13
 *
14
 * Using the Schema command line utility
15
 * cake schema run create DbAcl
16
 *
17
 */
18
class DbAclSchema extends CakeSchema {
19
 
20
/**
21
 * Before event.
22
 *
23
 * @param array $event The event data.
24
 * @return bool success
25
 */
26
	public function before($event = array()) {
27
		return true;
28
	}
29
 
30
/**
31
 * After event.
32
 *
33
 * @param array $event The event data.
34
 * @return void
35
 */
36
	public function after($event = array()) {
37
	}
38
 
39
/**
40
 * ACO - Access Control Object - Something that is wanted
41
 */
42
	public $acos = array(
43
		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
44
		'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
45
		'model' => array('type' => 'string', 'null' => true),
46
		'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
47
		'alias' => array('type' => 'string', 'null' => true),
48
		'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
49
		'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
50
		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
51
	);
52
 
53
/**
54
 * ARO - Access Request Object - Something that wants something
55
 */
56
	public $aros = array(
57
		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
58
		'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
59
		'model' => array('type' => 'string', 'null' => true),
60
		'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
61
		'alias' => array('type' => 'string', 'null' => true),
62
		'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
63
		'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
64
		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
65
	);
66
 
67
/**
68
 * Used by the Cake::Model:Permission class.
69
 * Checks if the given $aro has access to action $action in $aco.
70
 */
71
	public $aros_acos = array(
72
		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
73
		'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
74
		'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
75
		'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
76
		'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
77
		'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
78
		'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
79
		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
80
	);
81
 
82
}