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 +--- modules-available/locations/templates/location-subnets.html | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules-available/locations') 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 @@
{{#roomplanner}} - - {{lang_editRoomplan}} + + {{^perms.roomplanner.edit.disabled}}{{lang_editRoomplan}}{{/perms.roomplanner.edit.disabled}} + {{#perms.roomplanner.edit.disabled}}{{lang_showRoomplan}}{{/perms.roomplanner.edit.disabled}} {{/roomplanner}}
-- cgit v1.2.3-55-g7522