summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-09-13 12:42:48 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-09-13 12:42:48 -0400
commit1e7985a87a72bea9a308cf1506dacc828c6e2e1c (patch)
treed4251391dc74a9ff4628dd1bed551c34d806a1b6 /webapp/components/admin_console
parent05af5d14b8d07b010c70750ae1ac5ddf22c120a7 (diff)
downloadchat-1e7985a87a72bea9a308cf1506dacc828c6e2e1c.tar.gz
chat-1e7985a87a72bea9a308cf1506dacc828c6e2e1c.tar.bz2
chat-1e7985a87a72bea9a308cf1506dacc828c6e2e1c.zip
Modifying permissions system. (#3897)
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/user_item.jsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/webapp/components/admin_console/user_item.jsx b/webapp/components/admin_console/user_item.jsx
index 974ef8bc9..78fdb085c 100644
--- a/webapp/components/admin_console/user_item.jsx
+++ b/webapp/components/admin_console/user_item.jsx
@@ -97,12 +97,12 @@ export default class UserItem extends React.Component {
e.preventDefault();
const me = UserStore.getCurrentUser();
if (this.props.user.id === me.id) {
- this.handleDemote(this.props.user, 'admin');
+ this.handleDemote(this.props.user, 'team_user team_admin');
} else {
Client.updateRoles(
this.props.team.id,
this.props.user.id,
- 'admin',
+ 'team_user team_admin',
() => {
this.props.refreshProfiles();
},
@@ -119,7 +119,7 @@ export default class UserItem extends React.Component {
Client.updateRoles(
this.props.team.id,
this.props.user.id,
- 'system_admin',
+ 'system_user system_admin',
() => {
this.props.refreshProfiles();
},
@@ -238,11 +238,11 @@ export default class UserItem extends React.Component {
const me = UserStore.getCurrentUser();
const email = user.email;
- let showMakeMember = teamMember.roles === 'admin' || user.roles === 'system_admin';
- let showMakeAdmin = teamMember.roles === '' && user.roles !== 'system_admin';
- let showMakeSystemAdmin = user.roles === '' || user.roles === 'admin';
+ let showMakeMember = Utils.isAdmin(teamMember.roles) || Utils.isSystemAdmin(user.roles);
+ let showMakeAdmin = !Utils.isAdmin(teamMember.roles) && !Utils.isSystemAdmin(user.roles);
+ let showMakeSystemAdmin = !Utils.isSystemAdmin(user.roles);
let showMakeActive = false;
- let showMakeNotActive = user.roles !== 'system_admin';
+ let showMakeNotActive = !Utils.isSystemAdmin(user.roles);
const mfaEnabled = global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.MFA === 'true' && global.window.mm_config.EnableMultifactorAuthentication === 'true';
const showMfaReset = mfaEnabled && user.mfa_active;