diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-01-18 09:32:54 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-18 09:32:54 +1300 |
commit | 6171c7275a32c3ad9653aafaf673ab93254c8d1a (patch) | |
tree | 49828903f03061e2f72fc35130055927c8a346fc /web/app/view/AttributeAliasesController.js | |
parent | 4d092d96d6d872096abaf2f9883d2b578c5c8f72 (diff) | |
parent | 75828393fd64389be296c95bc67144b0c742cf48 (diff) | |
download | etbsa-traccar-web-6171c7275a32c3ad9653aafaf673ab93254c8d1a.tar.gz etbsa-traccar-web-6171c7275a32c3ad9653aafaf673ab93254c8d1a.tar.bz2 etbsa-traccar-web-6171c7275a32c3ad9653aafaf673ab93254c8d1a.zip |
Merge pull request #385 from Abyss777/manager
Implement user management
Diffstat (limited to 'web/app/view/AttributeAliasesController.js')
-rw-r--r-- | web/app/view/AttributeAliasesController.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/web/app/view/AttributeAliasesController.js b/web/app/view/AttributeAliasesController.js index 367a32a..1cbb735 100644 --- a/web/app/view/AttributeAliasesController.js +++ b/web/app/view/AttributeAliasesController.js @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton@traccar.org) - * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) + * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,8 +26,8 @@ Ext.define('Traccar.view.AttributeAliasesController', { ], init: function () { - var admin = Traccar.app.getUser().get('admin'); - this.lookupReference('deviceField').setStore(admin ? 'AllDevices' : 'Devices'); + var manager = Traccar.app.getUser().get('admin') || Traccar.app.getUser().get('userLimit') > 0; + this.lookupReference('deviceField').setStore(manager ? 'AllDevices' : 'Devices'); this.lookupReference('toolbarAddButton').setDisabled(true); this.lookupReference('toolbarEditButton').setDisabled(true); this.lookupReference('toolbarRemoveButton').setDisabled(true); @@ -88,11 +88,11 @@ Ext.define('Traccar.view.AttributeAliasesController', { }, onDeviceChange: function (combobox, newValue, oldValue) { - var admin = Traccar.app.getUser().get('admin'); + var manager = Traccar.app.getUser().get('admin') || Traccar.app.getUser().get('userLimit') > 0; this.onSelectionChange(''); if (newValue !== null) { this.getView().getStore().filter('deviceId', newValue); - if (admin && this.getView().getStore().getCount() === 0) { + if (manager && this.getView().getStore().getCount() === 0) { Ext.getStore('AttributeAliases').getProxy().setExtraParam('deviceId', newValue); Ext.getStore('AttributeAliases').load({ addRecords: true |