Commit 7067c4fa2d2f3d68a6c4f6f27918c7f5b72a2843
1 parent
7bc077ab
If there's a PEAR Error detecting the dynamic conditions, act as if
there aren't any, as there's nothing we can do at this point about it. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4000 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
9 deletions
lib/permissions/permissionutil.inc.php
| ... | ... | @@ -191,15 +191,17 @@ class KTPermissionUtil { |
| 191 | 191 | |
| 192 | 192 | if (!is_a($oFolderOrDocument, 'Folder')) { |
| 193 | 193 | $aDynamicConditions = KTPermissionDynamicCondition::getByPermissionObject($oPO); |
| 194 | - foreach ($aDynamicConditions as $oDynamicCondition) { | |
| 195 | - $iConditionId = $oDynamicCondition->getConditionId(); | |
| 196 | - if (KTSearchUtil::testConditionOnDocument($iConditionId, $oFolderOrDocument)) { | |
| 197 | - $iGroupId = $oDynamicCondition->getGroupId(); | |
| 198 | - $aPermissionIds = $oDynamicCondition->getAssignment(); | |
| 199 | - foreach ($aPermissionIds as $iPermissionId) { | |
| 200 | - $aCurrentAllowed = KTUtil::arrayGet($aMapPermAllowed, $iPermissionId, array()); | |
| 201 | - $aCurrentAllowed["group"][] = $iGroupId; | |
| 202 | - $aMapPermAllowed[$iPermissionId] = $aCurrentAllowed; | |
| 194 | + if (!PEAR::isError($aDynamicConditions)) { | |
| 195 | + foreach ($aDynamicConditions as $oDynamicCondition) { | |
| 196 | + $iConditionId = $oDynamicCondition->getConditionId(); | |
| 197 | + if (KTSearchUtil::testConditionOnDocument($iConditionId, $oFolderOrDocument)) { | |
| 198 | + $iGroupId = $oDynamicCondition->getGroupId(); | |
| 199 | + $aPermissionIds = $oDynamicCondition->getAssignment(); | |
| 200 | + foreach ($aPermissionIds as $iPermissionId) { | |
| 201 | + $aCurrentAllowed = KTUtil::arrayGet($aMapPermAllowed, $iPermissionId, array()); | |
| 202 | + $aCurrentAllowed["group"][] = $iGroupId; | |
| 203 | + $aMapPermAllowed[$iPermissionId] = $aCurrentAllowed; | |
| 204 | + } | |
| 203 | 205 | } |
| 204 | 206 | } |
| 205 | 207 | } | ... | ... |