File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
resources/scripts/components/server/files Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ import { bytesToString } from '@/lib/formatters';
1616import styles from './style.module.css' ;
1717
1818const Clickable : React . FC < { file : FileObject } > = memo ( ( { file, children } ) => {
19+ const [ canRead ] = usePermissions ( [ 'file.read' ] ) ;
1920 const [ canReadContents ] = usePermissions ( [ 'file.read-content' ] ) ;
2021 const directory = ServerContext . useStoreState ( ( state ) => state . files . directory ) ;
2122
2223 const match = useRouteMatch ( ) ;
2324
24- return ! canReadContents || ( file . isFile && ! file . isEditable ( ) ) ? (
25+ return ( file . isFile && ( ! file . isEditable ( ) || ! canReadContents ) ) || ( ! file . isFile && ! canRead ) ? (
2526 < div className = { styles . details } > { children } </ div >
2627 ) : (
2728 < NavLink
You can’t perform that action at this time.
0 commit comments