Skip to content

Commit

Permalink
No /admin page access if they are not enterprise (#2645)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzjames committed Jun 13, 2024
1 parent 166ae25 commit b89d0fc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/front-end/pages/admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ const Admin: FC = () => {

const { orgId, setOrgId, setSpecialOrg, apiCall } = useAuth();

const { superAdmin } = useUser();

const { license, superAdmin } = useUser();
const [orgs, setOrgs] = useState<OrganizationInterface[]>([]);
const [total, setTotal] = useState(0);
const [error, setError] = useState("");
Expand Down Expand Up @@ -239,10 +238,10 @@ const Admin: FC = () => {

const [orgModalOpen, setOrgModalOpen] = useState(false);

if (!superAdmin) {
if (license?.plan != "enterprise" || !superAdmin) {
return (
<div className="alert alert-danger">
Only super admins can view this page
Only super admins on an enterprise license can view this page
</div>
);
}
Expand Down

0 comments on commit b89d0fc

Please sign in to comment.