overleaf/services/web/frontend/js/shared/hooks/use-viewer-permissions.ts

13 lines
354 B
TypeScript
Raw Normal View History

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