diff options
author | George Goldberg <george@gberg.me> | 2017-02-24 01:15:10 +0000 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-02-23 20:15:10 -0500 |
commit | 8509c2f0b0893f8a7936a1943cc924db09bb62f4 (patch) | |
tree | 9b52c232fbc96fadaec26f0694ffc7e764651757 /webapp/stores | |
parent | bc9f3dfa240b2a197859de006baf2eceaafe0fcf (diff) | |
download | chat-8509c2f0b0893f8a7936a1943cc924db09bb62f4.tar.gz chat-8509c2f0b0893f8a7936a1943cc924db09bb62f4.tar.bz2 chat-8509c2f0b0893f8a7936a1943cc924db09bb62f4.zip |
PLT-5080 (WebApp): Channel Admin permission level. (#5047)
* PLT-5080 (WebApp): Channel Admin permission level.
For channel management and channel deletion.
* Fix some incorrect showing/hiding of options.
* Remove incorrect client calls that was overwriting my channel members.
Diffstat (limited to 'webapp/stores')
-rw-r--r-- | webapp/stores/channel_store.jsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index c46e17016..f303b0190 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -377,7 +377,17 @@ class ChannelStoreClass extends EventEmitter { } isChannelAdminForCurrentChannel() { - return this.isChannelAdmin(UserStore.getCurrentId(), this.getCurrentId()); + if (!Utils) { + Utils = require('utils/utils.jsx'); //eslint-disable-line global-require + } + + const member = this.getMyMember(this.getCurrentId()); + + if (!member) { + return false; + } + + return Utils.isChannelAdmin(member.roles); } isChannelAdmin(userId, channelId) { |