mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 23:47:06 +00:00
feat: completed org admin based project access feature
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user