|
1
|
|
|
<?php |
|
2
|
|
|
//------------------------------------------------------------------------- |
|
3
|
|
|
// OVIDENTIA http://www.ovidentia.org |
|
4
|
|
|
// Ovidentia is free software; you can redistribute it and/or modify |
|
5
|
|
|
// it under the terms of the GNU General Public License as published by |
|
6
|
|
|
// the Free Software Foundation; either version 2, or (at your option) |
|
7
|
|
|
// any later version. |
|
8
|
|
|
// |
|
9
|
|
|
// This program is distributed in the hope that it will be useful, but |
|
10
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
12
|
|
|
// See the GNU General Public License for more details. |
|
13
|
|
|
// |
|
14
|
|
|
// You should have received a copy of the GNU General Public License |
|
15
|
|
|
// along with this program; if not, write to the Free Software |
|
16
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
17
|
|
|
// USA. |
|
18
|
|
|
//------------------------------------------------------------------------- |
|
19
|
|
|
/** |
|
20
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL) |
|
21
|
|
|
* @copyright Copyright (c) 2008-2018 by CANTICO ({@link http://www.cantico.fr}) |
|
22
|
|
|
* @copyright Copyright (c) 2019 by CapWelton ({@link https://www.capwelton.com}) |
|
23
|
|
|
*/ |
|
24
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @property ORM_StringField $object |
|
29
|
|
|
* @property ORM_StringField $action |
|
30
|
|
|
* @property ORM_StringField $criterion |
|
31
|
|
|
* @property app_RoleSet $role |
|
32
|
|
|
* @method app_RoleSet role() |
|
33
|
|
|
* |
|
34
|
|
|
* @method app_RoleAccess get(mixed $criteria) |
|
35
|
|
|
* @method app_RoleAccess request(mixed $criteria) |
|
36
|
|
|
* @method app_RoleAccess[] select(\ORM_Criteria $criteria = null) |
|
37
|
|
|
* @method app_RoleAccess newRecord() |
|
38
|
|
|
*/ |
|
39
|
|
|
class app_RoleAccessSet extends app_RecordSet |
|
40
|
|
|
{ |
|
41
|
|
|
/** |
|
42
|
|
|
* |
|
43
|
|
|
* @param Func_App $App |
|
44
|
|
|
*/ |
|
45
|
|
|
public function __construct(Func_App $App = null) |
|
46
|
|
|
{ |
|
47
|
|
|
parent::__construct($App); |
|
|
|
|
|
|
48
|
|
|
|
|
49
|
|
|
$App = $this->App(); |
|
50
|
|
|
|
|
51
|
|
|
$this->setPrimaryKey('id'); |
|
52
|
|
|
|
|
53
|
|
|
$this->addFields( |
|
54
|
|
|
ORM_StringField('object') |
|
55
|
|
|
->setDescription('Object'), |
|
56
|
|
|
ORM_StringField('action') |
|
57
|
|
|
->setDescription('Action'), |
|
58
|
|
|
ORM_StringField('criterion') |
|
59
|
|
|
->setDescription('Criterion') |
|
60
|
|
|
); |
|
61
|
|
|
|
|
62
|
|
|
$this->hasOne('role', $App->RoleSetClassName()); |
|
|
|
|
|
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
|
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @property string $object |
|
70
|
|
|
* @property string $action |
|
71
|
|
|
* @property string $criterion |
|
72
|
|
|
* @property app_Role $role |
|
73
|
|
|
* @method app_Role role() |
|
74
|
|
|
* |
|
75
|
|
|
* @method app_RoleAccessSet getParentSet() |
|
76
|
|
|
*/ |
|
77
|
|
|
class app_RoleAccess extends app_Record |
|
78
|
|
|
{ |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
|