diff options
author | Corey Hulen <corey@hulen.com> | 2016-05-06 11:28:22 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-06 14:28:22 -0400 |
commit | 6c75662b824491a20a757a5eec59556a866374b5 (patch) | |
tree | 2f531a680aaa45bc915d51764eb846bc1b80fa68 /webapp/stores/user_store.jsx | |
parent | 4f799b980fd457e5dc97d2427a154576d7a5eded (diff) | |
download | chat-6c75662b824491a20a757a5eec59556a866374b5.tar.gz chat-6c75662b824491a20a757a5eec59556a866374b5.tar.bz2 chat-6c75662b824491a20a757a5eec59556a866374b5.zip |
PLT-2697 Fixing team admins (#2900)
* PLT-2697 Fixing team admins
* Fixing eslint error
* Fixing loc issues
* Fixing func
* Fixing func
Diffstat (limited to 'webapp/stores/user_store.jsx')
-rw-r--r-- | webapp/stores/user_store.jsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/webapp/stores/user_store.jsx b/webapp/stores/user_store.jsx index 8ae1e1404..855222d47 100644 --- a/webapp/stores/user_store.jsx +++ b/webapp/stores/user_store.jsx @@ -13,6 +13,8 @@ const CHANGE_EVENT_SESSIONS = 'change_sessions'; const CHANGE_EVENT_AUDITS = 'change_audits'; const CHANGE_EVENT_STATUSES = 'change_statuses'; +var Utils; + class UserStoreClass extends EventEmitter { constructor() { super(); @@ -314,6 +316,20 @@ class UserStoreClass extends EventEmitter { setNoAccounts(noAccounts) { this.noAccounts = noAccounts; } + + isSystemAdminForCurrentUser() { + if (!Utils) { + Utils = require('utils/utils.jsx'); //eslint-disable-line global-require + } + + var current = this.getCurrentUser(); + + if (current) { + return Utils.isAdmin(current.roles); + } + + return false; + } } var UserStore = new UserStoreClass(); |