Skip to content
Snippets Groups Projects
Commit a8462e98 authored by William Enright's avatar William Enright Committed by Larbi Gharib
Browse files

Hide Update button to non-admin users

Change-Id: I600feff5833ed45b661534d69670355b1f7e8f82
parent 713a4584
Branches
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ export default function Sidebar(props) { ...@@ -44,7 +44,7 @@ export default function Sidebar(props) {
React.useEffect(() => { React.useEffect(() => {
if(auth.isUpdateAvailable()) if(auth.isUpdateAvailable() && auth.hasAdminScope())
setOpen(true) setOpen(true)
}, [mainPanel]); }, [mainPanel]);
......
...@@ -117,6 +117,7 @@ export default function Admin({ ...rest }) { ...@@ -117,6 +117,7 @@ export default function Admin({ ...rest }) {
const handleQuery = () => { const handleQuery = () => {
setQuery(true); setQuery(true);
if (auth.hasAdminScope()) {
if (auth.isActivated()) { if (auth.isActivated()) {
setDialogMessage( setDialogMessage(
"A new version of JAMS is available. Would you like to update now?" "A new version of JAMS is available. Would you like to update now?"
...@@ -130,6 +131,9 @@ export default function Admin({ ...rest }) { ...@@ -130,6 +131,9 @@ export default function Admin({ ...rest }) {
setMessageYes("Yes, go to Jami Store"); setMessageYes("Yes, go to Jami Store");
setMessageNo("No thanks"); setMessageNo("No thanks");
} }
} else
setDialogMessage("You are not allowed to access this section. Please contact your administrator to get administrator privileges.");
}; };
// initialize and destroy the PerfectScrollbar plugin // initialize and destroy the PerfectScrollbar plugin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment