Skip to content

Commit a830586

Browse files
Boy132matthewpi
authored andcommitted
only files check for "read-content", check folders for "read"
fixes pterodactyl#4792
1 parent 987440c commit a830586

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

resources/scripts/components/server/files/FileObjectRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ import { bytesToString } from '@/lib/formatters';
1616
import styles from './style.module.css';
1717

1818
const 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

0 commit comments

Comments
 (0)