統計
| ブランチ: | リビジョン:

pictcode / lib / Cake / Test / test_app / Config / acl.php @ 635eef61

履歴 | 表示 | アノテート | ダウンロード (2.301 KB)

1
<?php
2
/*
3
 * Test App PHP Based Acl Config File
4
 *
5
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
7
 *
8
 *  Licensed under The MIT License
9
 *  Redistributions of files must retain the above copyright notice.
10
 *
11
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
12
 * @link          http://cakephp.org CakePHP(tm) Project
13
 * @package       Cake.Test.TestApp.Config
14
 * @since         CakePHP(tm) v 0.10.0.1076
15
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
16
 */
17

    
18
// -------------------------------------
19
// Roles
20
// -------------------------------------
21
$config['roles'] = array(
22
        'Role/admin'                                => null,
23
        'Role/data_acquirer'                => null,
24
        'Role/accounting'                        => null,
25
        'Role/database_manager'                => null,
26
        'Role/sales'                                => null,
27
        'Role/data_analyst'                        => 'Role/data_acquirer, Role/database_manager',
28
        'Role/reports'                                => 'Role/data_analyst',
29
        // allow inherited roles to be defined as an array or comma separated list
30
        'Role/manager'                                => array(
31
                'Role/accounting',
32
                'Role/sales',
33
        ),
34
        'Role/accounting_manager'        => 'Role/accounting',
35
        // managers
36
        'User/hardy'                                => 'Role/accounting_manager, Role/reports',
37
        'User/stan'                                        => 'Role/manager',
38
        // accountants
39
        'User/peter'                                => 'Role/accounting',
40
        'User/jeff'                                        => 'Role/accounting',
41
        // admins
42
        'User/jan'                                        => 'Role/admin',
43
        // database
44
        'User/db_manager_1'                        => 'Role/database_manager',
45
        'User/db_manager_2'                        => 'Role/database_manager',
46
);
47

    
48
//-------------------------------------
49
// Rules
50
//-------------------------------------
51
$config['rules']['allow'] = array(
52
        '/*' => 'Role/admin',
53
        '/controllers/*/manager_*' => 'Role/manager',
54
        '/controllers/reports/*' => 'Role/sales',
55
        '/controllers/invoices/*' => 'Role/accounting',
56
        '/controllers/invoices/edit' => 'User/db_manager_2',
57
        '/controllers/db/*' => 'Role/database_manager',
58
        '/controllers/*/(add|edit|publish)' => 'User/stan',
59
        '/controllers/users/dashboard' => 'Role/default',
60
        // test for case insensitivity
61
        'controllers/Forms/NEW' => 'Role/data_acquirer',
62
);
63
$config['rules']['deny'] = array(
64
        // accountants and sales should not delete anything
65
        '/controllers/*/delete' => array(
66
                'Role/sales',
67
                'Role/accounting'
68
        ),
69
        '/controllers/db/drop' => 'User/db_manager_2',
70
);