diff --git a/src/pages/ProjectManagerPage/ProjectAnatomy.jsx b/src/pages/ProjectManagerPage/ProjectAnatomy.jsx index 60cd02400..ec902a90d 100644 --- a/src/pages/ProjectManagerPage/ProjectAnatomy.jsx +++ b/src/pages/ProjectManagerPage/ProjectAnatomy.jsx @@ -2,6 +2,7 @@ import { toast } from 'react-toastify' import { useState } from 'react' import { ScrollPanel, SaveButton, Spacer, Button } from '@ynput/ayon-react-components' import { useUpdateProjectAnatomyMutation } from '@queries/project/updateProject' +import { useGetCurrentUserProjectPermissionsQuery } from '@queries/permissions/getPermissions' import ProjectManagerPageLayout from './ProjectManagerPageLayout' import AnatomyEditor from '@containers/AnatomyEditor' @@ -15,6 +16,15 @@ const ProjectAnatomy = ({ projectName, projectList }) => { const [updateProjectAnatomy, { isLoading: isUpdating }] = useUpdateProjectAnatomyMutation() const { requestPaste } = usePaste() + + const { data: permissions } = useGetCurrentUserProjectPermissionsQuery({ + projectName: projectName, + }) + + const accessLevel = permissions?.project?.enabled ? permissions.project.anatomy : 2 + //const accessLevel = 2 + + const saveAnatomy = () => { updateProjectAnatomy({ projectName, anatomy: formData }) .unwrap() @@ -62,23 +72,25 @@ const ProjectAnatomy = ({ projectName, projectList }) => { }} />