only files check for "read-content", check folders for "read"
fixes #4792
This commit is contained in:
parent
987440c8ca
commit
a83058668f
1 changed files with 2 additions and 1 deletions
|
@ -16,12 +16,13 @@ import { bytesToString } from '@/lib/formatters';
|
||||||
import styles from './style.module.css';
|
import styles from './style.module.css';
|
||||||
|
|
||||||
const Clickable: React.FC<{ file: FileObject }> = memo(({ file, children }) => {
|
const Clickable: React.FC<{ file: FileObject }> = memo(({ file, children }) => {
|
||||||
|
const [canRead] = usePermissions(['file.read']);
|
||||||
const [canReadContents] = usePermissions(['file.read-content']);
|
const [canReadContents] = usePermissions(['file.read-content']);
|
||||||
const directory = ServerContext.useStoreState((state) => state.files.directory);
|
const directory = ServerContext.useStoreState((state) => state.files.directory);
|
||||||
|
|
||||||
const match = useRouteMatch();
|
const match = useRouteMatch();
|
||||||
|
|
||||||
return !canReadContents || (file.isFile && !file.isEditable()) ? (
|
return (file.isFile && (!file.isEditable() || !canReadContents)) || (!file.isFile && !canRead) ? (
|
||||||
<div className={styles.details}>{children}</div>
|
<div className={styles.details}>{children}</div>
|
||||||
) : (
|
) : (
|
||||||
<NavLink
|
<NavLink
|
||||||
|
|
Loading…
Reference in a new issue