diff options
author | Simon Rettberg | 2018-02-27 17:02:40 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-27 17:02:40 +0100 |
commit | 873d6af8bc843c6eea6049ace2f5218a371f01d4 (patch) | |
tree | 5b85346b327d9397ab3c2faa224c54bc43dd4295 /modules-available/locations | |
parent | [dnbd3] Implement permissions (diff) | |
download | slx-admin-873d6af8bc843c6eea6049ace2f5218a371f01d4.tar.gz slx-admin-873d6af8bc843c6eea6049ace2f5218a371f01d4.tar.xz slx-admin-873d6af8bc843c6eea6049ace2f5218a371f01d4.zip |
[roomplanner] Add permissions
Diffstat (limited to 'modules-available/locations')
-rw-r--r-- | modules-available/locations/page.inc.php | 4 | ||||
-rw-r--r-- | modules-available/locations/templates/location-subnets.html | 6 |
2 files changed, 5 insertions, 5 deletions
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 @@ </div> <div class="col-md-4 text-center"> {{#roomplanner}} - <a class="btn btn-default {{perms.roomplanner.edit.disabled}}" href="?do=roomplanner&locationid={{locationid}}" target="_blank" + <a class="btn btn-default" href="?do=roomplanner&locationid={{locationid}}" target="_blank" onclick="window.open(this.href, '_blank', 'toolbar=0,scrollbars,resizable');return false"> - <span class="glyphicon glyphicon-move"></span> {{lang_editRoomplan}} + <span class="glyphicon glyphicon-move"></span> + {{^perms.roomplanner.edit.disabled}}{{lang_editRoomplan}}{{/perms.roomplanner.edit.disabled}} + {{#perms.roomplanner.edit.disabled}}{{lang_showRoomplan}}{{/perms.roomplanner.edit.disabled}} </a> {{/roomplanner}} </div> |