From 873d6af8bc843c6eea6049ace2f5218a371f01d4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 27 Feb 2018 17:02:40 +0100 Subject: [roomplanner] Add permissions --- modules-available/locations/page.inc.php | 4 +- .../locations/templates/location-subnets.html | 6 +- .../roomplanner/hooks/runmode/config.json | 3 +- modules-available/roomplanner/js/grid.js | 85 ++--- modules-available/roomplanner/page.inc.php | 45 ++- .../roomplanner/permissions/permissions.json | 11 +- modules-available/roomplanner/style.css | 3 + .../roomplanner/templates/footer.html | 59 ++++ .../roomplanner/templates/header.html | 49 +++ .../roomplanner/templates/item-selector.html | 314 ++++++++++++++++++ .../roomplanner/templates/main-roomplan.html | 18 + modules-available/roomplanner/templates/page.html | 369 --------------------- 12 files changed, 534 insertions(+), 432 deletions(-) create mode 100644 modules-available/roomplanner/templates/footer.html create mode 100644 modules-available/roomplanner/templates/header.html create mode 100644 modules-available/roomplanner/templates/item-selector.html create mode 100644 modules-available/roomplanner/templates/main-roomplan.html delete mode 100644 modules-available/roomplanner/templates/page.html diff --git a/modules-available/locations/page.inc.php b/modules-available/locations/page.inc.php index 08f9b518..0a6fdb10 100644 --- a/modules-available/locations/page.inc.php +++ b/modules-available/locations/page.inc.php @@ -495,9 +495,7 @@ class Page_Locations extends Page { $locationId = Request::any('locationid', 0, 'integer'); - if (!User::hasPermission("location.view", $locationId)) { - die('Permission denied'); - } + User::assertPermission("location.view", $locationId); $loc = Database::queryFirst('SELECT locationid, parentlocationid, locationname FROM location WHERE locationid = :lid', array('lid' => $locationId)); diff --git a/modules-available/locations/templates/location-subnets.html b/modules-available/locations/templates/location-subnets.html index 9db75f0b..db94be0a 100644 --- a/modules-available/locations/templates/location-subnets.html +++ b/modules-available/locations/templates/location-subnets.html @@ -75,9 +75,11 @@