feat: completed org admin based project access feature

This commit is contained in:
=
2024-08-02 19:54:42 +05:30
parent 7f9150e60e
commit 13e0dd8e0f
29 changed files with 649 additions and 15 deletions
@@ -59,6 +59,7 @@ import {
OrgPermissionActions,
OrgPermissionSubjects,
useOrganization,
useOrgPermission,
useSubscription,
useUser,
useWorkspace
@@ -131,6 +132,8 @@ export const AppLayout = ({ children }: LayoutProps) => {
const { workspaces, currentWorkspace } = useWorkspace();
const { orgs, currentOrg } = useOrganization();
const { membership } = useOrgPermission();
const isOrgAdmin = membership?.role === "admin";
const { data: projectFavorites } = useGetUserProjectFavorites(currentOrg?.id!);
const { mutateAsync: updateUserProjectFavorites } = useUpdateUserProjectFavorites();
@@ -748,6 +751,18 @@ export const AppLayout = ({ children }: LayoutProps) => {
</a>
</Link>
)}
{isOrgAdmin && (
<Link href={`/org/${currentOrg?.id}/admin`} passHref>
<a>
<MenuItem
isSelected={router.asPath === `/org/${currentOrg?.id}/admin`}
icon="system-outline-109-slider-toggle-settings"
>
Admin
</MenuItem>
</a>
</Link>
)}
<Link href={`/org/${currentOrg?.id}/settings`} passHref>
<a>
<MenuItem