From 857871042aecee5afa3ee5001ab814c9dbbb4587 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 24 Jan 2019 17:30:55 +0800 Subject: [PATCH] * finish task #5238. --- module/action/model.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 5a67dbab75..9dfe977eb5 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -750,7 +750,7 @@ class actionModel extends model } $objectNames['user'][0] = 'guest'; // Add guest account. - foreach($actions as $action) + foreach($actions as $i => $action) { /* Add name field to the actions. */ $action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : ''; @@ -779,11 +779,14 @@ class actionModel extends model { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); $action->objectLink = ''; - if(common::hasPriv($moduleName, $methodName)) + if(!common::hasPriv($moduleName, $methodName)) { - $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); - if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + unset($actions[$i]); + continue; } + + $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); + if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); $action->objectLabel = $objectLabel; } else