From 1f296157a630a81b0799ece8fa9025b0fbba203b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 16 Dec 2015 13:02:06 +1300 Subject: Hide edit buttons in readonly mode --- web/app/view/DevicesController.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/app/view') diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index c29854d12..8c6c72725 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -33,6 +33,12 @@ Ext.define('Traccar.view.DevicesController', { } } }, + init: function () { + var readonly = Traccar.app.getServer().get('readonly') && !Traccar.app.getUser().get('admin'); + this.lookupReference('toolbarAddButton').setVisible(!readonly); + this.lookupReference('toolbarEditButton').setVisible(!readonly); + this.lookupReference('toolbarRemoveButton').setVisible(!readonly); + }, onAddClick: function () { var device, dialog; -- cgit v1.2.3