Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
11 / 11 |
|
100.00% |
9 / 9 |
CRAP | |
100.00% |
2 / 2 |
SeedDMS_Core_UserAccess | |
100.00% |
6 / 6 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 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 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getUser | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
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-2024 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-2024 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->_user->isAdmin()); |
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, |
84 | * 2010-2024 Uwe Steinmann |
85 | * @version Release: @package_version@ |
86 | */ |
87 | class SeedDMS_Core_GroupAccess { /* {{{ */ |
88 | |
89 | /** |
90 | * @var SeedDMS_Core_Group |
91 | */ |
92 | var $_group; |
93 | |
94 | /** |
95 | * @var |
96 | */ |
97 | var $_mode; |
98 | |
99 | /** |
100 | * SeedDMS_Core_GroupAccess constructor. |
101 | * @param $group |
102 | * @param $mode |
103 | */ |
104 | function __construct($group, $mode) { |
105 | $this->_group = $group; |
106 | $this->_mode = $mode; |
107 | } |
108 | |
109 | /** |
110 | * @return int |
111 | */ |
112 | function getGroupID() { return $this->_group->getID(); } |
113 | |
114 | /** |
115 | * @return mixed |
116 | */ |
117 | function getMode() { return $this->_mode; } |
118 | |
119 | /** |
120 | * @return SeedDMS_Core_Group |
121 | */ |
122 | function getGroup() { |
123 | return $this->_group; |
124 | } |
125 | } /* }}} */ |