fix: manage user btn will only show for admins (#5238)

This commit is contained in:
Muhsin Shah C P 2023-01-09 13:27:25 +05:30 committed by GitHub
parent 84e603124d
commit e583e36c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
import React from 'react';
import { appService } from '@/_services';
import { appService, authenticationService } from '@/_services';
import Modal from 'react-bootstrap/Modal';
import Button from 'react-bootstrap/Button';
import { toast } from 'react-hot-toast';
@ -13,6 +13,7 @@ import { Link } from 'react-router-dom';
class ManageAppUsersComponent extends React.Component {
constructor(props) {
super(props);
this.currentUser = authenticationService.currentUserValue;
this.state = {
showModal: false,
@ -258,9 +259,11 @@ class ManageAppUsersComponent extends React.Component {
</Modal.Body>
<Modal.Footer>
<Link to="/organization-settings" target="_blank" className="btn color-primary mt-3">
Manage users
</Link>
{this.currentUser?.admin && (
<Link to="/organization-settings" target="_blank" className="btn color-primary mt-3">
Manage users
</Link>
)}
</Modal.Footer>
</Modal>
</div>