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