Commit d1baf2a70964bdb1196c1e44adfd25bb178178a2
1 parent
282b1468
KTS-1187: Make it so that immutable documents can't be deleted using
bulk actions (this is for the direct selection of documents) git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5751 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
6 additions
and
0 deletions
browse.php
| ... | ... | @@ -724,9 +724,15 @@ class BrowseDispatcher extends KTStandardDispatcher { |
| 724 | 724 | $documentStr = '<strong>' . _kt('Documents: ') . '</strong>'; |
| 725 | 725 | foreach ($aDocumentSelection as $iDocId) { |
| 726 | 726 | $oD = Document::get($iDocId); |
| 727 | + if (PEAR::isError($oD)) { | |
| 728 | + continue; | |
| 729 | + } | |
| 727 | 730 | if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oD)) { |
| 728 | 731 | $this->errorRedirectToMain(_kt('You do not have permission to delete the document: ') . $oD->getName()); |
| 729 | 732 | } |
| 733 | + if ($oD->getImmutable()) { | |
| 734 | + $this->errorRedirectToMain(_kt('This document is immutable and cannot be deleted: ') . $oD->getName()); | |
| 735 | + } | |
| 730 | 736 | if (!PEAR::isError($oD)) { |
| 731 | 737 | $delItems['documents'][] = $oD->getName(); |
| 732 | 738 | } | ... | ... |