overleaf/services/web/frontend/js/shared/hooks/use-viewer-permissions.ts
roo hutton bf90932f40 Merge pull request #18936 from overleaf/rh-viewer-no-comment
[web] Remove access to commenting/chat for collaborators with Viewer permission

GitOrigin-RevId: 03957cb8c04866318a4b94bdb72843e7d7a5a003
2024-06-26 08:04:38 +00:00

12 lines
354 B
TypeScript

import { useEditorContext } from '../context/editor-context'
import getMeta from '@/utils/meta'
function useViewerPermissions() {
const { permissionsLevel } = useEditorContext()
const hasViewerPermissions =
getMeta('ol-linkSharingWarning') && permissionsLevel === 'readOnly'
return hasViewerPermissions
}
export default useViewerPermissions