summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-09-29 17:28:59 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-09-29 17:28:59 -0400
commitfb9fe1995ca7502bea23e1ab7082e8c8757251fb (patch)
treea79e62ded0c7f8bd27e0317ad599483132111bfa /web/react
parent08af14abc9c1a7cefc4e516360b4a2c8cd6dcc05 (diff)
parent0c4227994bf0b33b129de4075c591e228a93c8de (diff)
downloadchat-fb9fe1995ca7502bea23e1ab7082e8c8757251fb.tar.gz
chat-fb9fe1995ca7502bea23e1ab7082e8c8757251fb.tar.bz2
chat-fb9fe1995ca7502bea23e1ab7082e8c8757251fb.zip
Merge pull request #862 from mattermost/PLT-435
PLT-435 adding system console link to RHS
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/navbar_dropdown.jsx2
-rw-r--r--web/react/components/sidebar_right_menu.jsx15
-rw-r--r--web/react/utils/utils.jsx8
3 files changed, 24 insertions, 1 deletions
diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index 4c01d2c43..57a78a0d4 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -62,7 +62,7 @@ export default class NavbarDropdown extends React.Component {
if (currentUser != null) {
isAdmin = Utils.isAdmin(currentUser.roles);
- isSystemAdmin = Utils.isInRole(currentUser.roles, 'system_admin');
+ isSystemAdmin = Utils.isSystemAdmin(currentUser.roles);
inviteLink = (
<li>
diff --git a/web/react/components/sidebar_right_menu.jsx b/web/react/components/sidebar_right_menu.jsx
index f1341d9d7..2df2c8ffd 100644
--- a/web/react/components/sidebar_right_menu.jsx
+++ b/web/react/components/sidebar_right_menu.jsx
@@ -26,11 +26,14 @@ export default class SidebarRightMenu extends React.Component {
var inviteLink = '';
var teamSettingsLink = '';
var manageLink = '';
+ var consoleLink = '';
var currentUser = UserStore.getCurrentUser();
var isAdmin = false;
+ var isSystemAdmin = false;
if (currentUser != null) {
isAdmin = utils.isAdmin(currentUser.roles);
+ isSystemAdmin = utils.isSystemAdmin(currentUser.roles);
inviteLink = (
<li>
@@ -77,6 +80,17 @@ export default class SidebarRightMenu extends React.Component {
);
}
+ if (isSystemAdmin) {
+ consoleLink = (
+ <li>
+ <a
+ href='/admin_console'
+ >
+ <i className='glyphicon glyphicon-wrench'></i>System Console</a>
+ </li>
+ );
+ }
+
var siteName = '';
if (global.window.config.SiteName != null) {
siteName = global.window.config.SiteName;
@@ -107,6 +121,7 @@ export default class SidebarRightMenu extends React.Component {
{inviteLink}
{teamLink}
{manageLink}
+ {consoleLink}
<li>
<a
href='#'
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index ad4575c6e..91e47730e 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -78,6 +78,14 @@ export function isAdmin(roles) {
return false;
}
+export function isSystemAdmin(roles) {
+ if (isInRole(roles, 'system_admin')) {
+ return true;
+ }
+
+ return false;
+}
+
export function getDomainWithOutSub() {
var parts = window.location.host.split('.');