From 6d6c65db4a41c952689fa01cfbf31b424b817929 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Feb 2018 18:09:08 +0100 Subject: [statistics] Rename permissions a bit --- modules-available/statistics/page.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules-available/statistics/page.inc.php') diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index 5fe4ebfa..e89180ed 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -170,7 +170,7 @@ class Page_Statistics extends Page $uuid = Request::post('uuid', '', 'string'); $locationid = Database::queryFirst('SELECT locationid FROM machine WHERE machineuuid = :uuid', array('uuid' => $uuid))['locationid']; - if (User::hasPermission("note", $locationid)) { + if (User::hasPermission("machine.note", $locationid)) { $text = Request::post('content', '', 'string'); if (empty($text)) { $text = null; @@ -207,7 +207,7 @@ class Page_Statistics extends Page $res = Database::simpleQuery('SELECT machineuuid, locationid FROM machine WHERE machineuuid IN (:ids)', compact('ids')); $ids = array_flip($ids); $delete = []; - $allowedLocations = User::getAllowedLocations("delete"); + $allowedLocations = User::getAllowedLocations("machine.delete"); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { if (in_array($row['locationid'], $allowedLocations)) { unset($ids[$row['machineuuid']]); @@ -629,7 +629,7 @@ class Page_Statistics extends Page . " $join WHERE $where $sort", $args); $rows = array(); $singleMachine = 'none'; - $deleteAllowedLocations = User::getAllowedLocations("delete"); + $deleteAllowedLocations = User::getAllowedLocations("machine.delete"); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { if ($singleMachine === 'none') { $singleMachine = $row['machineuuid']; @@ -1002,7 +1002,7 @@ class Page_Statistics extends Page )); } // Notes - $client["notesAllowed"] = User::hasPermission("note", $client["locationid"]); + $client["notesAllowed"] = User::hasPermission("machine.note", $client["locationid"]); Render::addTemplate('machine-notes', $client); } -- cgit v1.2.3-55-g7522