Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
81.82% |
9 / 11 |
|
77.78% |
7 / 9 |
CRAP | |
50.00% |
1 / 2 |
SeedDMS_Core_UserAccess | |
66.67% |
4 / 6 |
|
60.00% |
3 / 5 |
5.93 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getUserID | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isAdmin | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
SeedDMS_Core_GroupAccess | |
100.00% |
5 / 5 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getGroupID | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getGroup | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Implementation of user and group access object |
4 | * |
5 | * @category DMS |
6 | * @package SeedDMS_Core |
7 | * @license GPL 2 |
8 | * @version @version@ |
9 | * @author Uwe Steinmann <uwe@steinmann.cx> |
10 | * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, |
11 | * 2010 Uwe Steinmann |
12 | * @version Release: @package_version@ |
13 | */ |
14 | |
15 | /** |
16 | * Class to represent a user access right. |
17 | * This class cannot be used to modify access rights. |
18 | * |
19 | * @category DMS |
20 | * @package SeedDMS_Core |
21 | * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx> |
22 | * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, |
23 | * 2010 Uwe Steinmann |
24 | * @version Release: @package_version@ |
25 | */ |
26 | class SeedDMS_Core_UserAccess { /* {{{ */ |
27 | |
28 | /** |
29 | * @var SeedDMS_Core_User |
30 | */ |
31 | var $_user; |
32 | |
33 | /** |
34 | * @var |
35 | */ |
36 | var $_mode; |
37 | |
38 | /** |
39 | * SeedDMS_Core_UserAccess constructor. |
40 | * @param $user |
41 | * @param $mode |
42 | */ |
43 | function __construct($user, $mode) { |
44 | $this->_user = $user; |
45 | $this->_mode = $mode; |
46 | } |
47 | |
48 | /** |
49 | * @return int |
50 | */ |
51 | function getUserID() { return $this->_user->getID(); } |
52 | |
53 | /** |
54 | * @return mixed |
55 | */ |
56 | function getMode() { return $this->_mode; } |
57 | |
58 | /** |
59 | * @return bool |
60 | */ |
61 | function isAdmin() { |
62 | return ($this->_mode == SeedDMS_Core_User::role_admin); |
63 | } |
64 | |
65 | /** |
66 | * @return SeedDMS_Core_User |
67 | */ |
68 | function getUser() { |
69 | return $this->_user; |
70 | } |
71 | } /* }}} */ |
72 | |
73 | |
74 | /** |
75 | * Class to represent a group access right. |
76 | * This class cannot be used to modify access rights. |
77 | * |
78 | * @category DMS |
79 | * @package SeedDMS_Core |
80 | * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx> |
81 | * @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, 2010 Uwe Steinmann |
82 | * @version Release: @package_version@ |
83 | */ |
84 | class SeedDMS_Core_GroupAccess { /* {{{ */ |
85 | |
86 | /** |
87 | * @var SeedDMS_Core_Group |
88 | */ |
89 | var $_group; |
90 | |
91 | /** |
92 | * @var |
93 | */ |
94 | var $_mode; |
95 | |
96 | /** |
97 | * SeedDMS_Core_GroupAccess constructor. |
98 | * @param $group |
99 | * @param $mode |
100 | */ |
101 | function __construct($group, $mode) { |
102 | $this->_group = $group; |
103 | $this->_mode = $mode; |
104 | } |
105 | |
106 | /** |
107 | * @return int |
108 | */ |
109 | function getGroupID() { return $this->_group->getID(); } |
110 | |
111 | /** |
112 | * @return mixed |
113 | */ |
114 | function getMode() { return $this->_mode; } |
115 | |
116 | /** |
117 | * @return SeedDMS_Core_Group |
118 | */ |
119 | function getGroup() { |
120 | return $this->_group; |
121 | } |
122 | } /* }}} */ |