Skip to content

Commit 24f7c3b

Browse files
author
unclecheese
committed
Merge pull request #76 from hdrlab/patch-1
Hide edit/delete links based on canEdit(), etc.
2 parents 5e80298 + 2155977 commit 24f7c3b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

code/DataObjectManager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,9 @@ public function Actions()
712712
$action = false;
713713
switch($perm) {
714714
case "edit":
715+
if(!$this->item->canEdit()) continue;
715716
case "view":
717+
if(!$this->item->canView()) continue;
716718
$actions->push(new DataObjectManagerAction(
717719
$this->ViewOrEdit_i18n(),
718720
$this->EditLink(),
@@ -724,6 +726,7 @@ public function Actions()
724726
break;
725727

726728
case "delete":
729+
if(!$this->item->canDelete()) continue;
727730
$actions->push(new DataObjectManagerAction(
728731
_t('DataObjectManager.DELETE','Delete'),
729732
$this->DeleteLink(),
@@ -735,6 +738,7 @@ public function Actions()
735738
break;
736739

737740
case "duplicate":
741+
if(!$this->item->canCreate()) continue;
738742
$actions->push(new DataObjectManagerAction(
739743
_t('DataObjectManager.DUPLICATE','Duplicate'),
740744
$this->DuplicateLink(),

0 commit comments

Comments
 (0)