@@ -53,9 +53,12 @@ protected function __construct()
53
53
*/
54
54
public function checkFilterACL (Tinebase_Model_Filter_FilterGroup $ _filter , $ _action = self ::ACTION_GET )
55
55
{
56
- if (!$ this ->_doContainerACLChecks || $ this ->checkRight (Admin_Acl_Rights::MANAGE_ACCOUNTS )) {
56
+ if (!$ this ->_doRightChecks
57
+ || !$ this ->_doContainerACLChecks
58
+ || $ this ->checkRight (Admin_Acl_Rights::MANAGE_ACCOUNTS )
59
+ ) {
57
60
if (Tinebase_Core::isLogLevel (Zend_Log::TRACE )) Tinebase_Core::getLogger ()->trace (__METHOD__ . ':: ' . __LINE__
58
- . ' Container ACL disabled for ' . $ _filter ->getModelName () . '. ' );
61
+ . ' ACL / right checks disabled for ' . $ _filter ->getModelName () . '. ' );
59
62
return ;
60
63
}
61
64
@@ -75,6 +78,10 @@ public function checkFilterACL(Tinebase_Model_Filter_FilterGroup $_filter, $_act
75
78
*/
76
79
protected function _checkRight ($ _action )
77
80
{
81
+ if (! $ this ->_doRightChecks ) {
82
+ return ;
83
+ }
84
+
78
85
switch ($ _action ) {
79
86
case 'get ' :
80
87
$ this ->checkRight (Admin_Acl_Rights::MANAGE_ACCOUNTS );
@@ -98,13 +105,15 @@ protected function _getApplicationRightsClass(): string
98
105
99
106
public function getMatrixAccountForCurrentUser (): MatrixSynapseIntegrator_Model_MatrixAccount
100
107
{
108
+ $ check = $ this ->doRightChecks (false );
101
109
/** @var ?MatrixSynapseIntegrator_Model_MatrixAccount $result */
102
110
$ result = $ this ->search (Tinebase_Model_Filter_FilterGroup::getFilterForModel (
103
111
MatrixSynapseIntegrator_Model_MatrixAccount::class, [[
104
112
Tinebase_Model_Filter_Abstract::FIELD => MatrixSynapseIntegrator_Model_MatrixAccount::FLD_ACCOUNT_ID ,
105
113
Tinebase_Model_Filter_Abstract::VALUE => Tinebase_Core::getUser ()->getId ()
106
114
]]
107
115
))->getFirstRecord ();
116
+ $ this ->doRightChecks ($ check );
108
117
if (!$ result ) {
109
118
throw new Tinebase_Exception_NotFound ('No Matrix Account found ' );
110
119
}
0 commit comments