11import { useState , useEffect } from 'react'
22import { App } from 'antd'
3- import { FileManager , ExtendedFileManagerProps } from '../components/file_manager/fileManager'
3+ import { FileManager } from '../components/file_manager/fileManager'
4+ import { FileManagerProps } from '../components/file_manager/interfaces'
45import { StorageObject } from '../components/file_manager/interfaces'
56import { useParams } from '@tanstack/react-router'
67import { useAuth } from '../contexts/AuthContext'
78import { workspaceService } from '../services/api/workspace'
89import { Workspace , FileManagerSettings } from '../services/api/types'
10+ import { useWorkspacePermissions } from '../contexts/AuthContext'
911
1012export function FileManagerPage ( ) {
1113 const { workspaceId } = useParams ( { from : '/workspace/$workspaceId' } )
1214 const { workspaces, refreshWorkspaces } = useAuth ( )
15+ const { permissions } = useWorkspacePermissions ( workspaceId )
1316 const [ currentWorkspace , setCurrentWorkspace ] = useState < Workspace | null > ( null )
1417 const { message } = App . useApp ( )
1518
@@ -66,7 +69,7 @@ export function FileManagerPage() {
6669 }
6770 }
6871
69- const fileManagerProps : ExtendedFileManagerProps = {
72+ const fileManagerProps : FileManagerProps = {
7073 currentPath : '' ,
7174 onError : handleError ,
7275 onSelect : handleSelect ,
@@ -83,7 +86,8 @@ export function FileManagerPage() {
8386 secret_key : currentWorkspace ?. settings ?. file_manager ?. secret_key || '' ,
8487 cdn_endpoint : currentWorkspace ?. settings ?. file_manager ?. cdn_endpoint || ''
8588 } ,
86- onUpdateSettings : handleUpdateSettings
89+ onUpdateSettings : handleUpdateSettings ,
90+ readOnly : ! permissions ?. templates ?. write
8791 }
8892
8993 // console.log('fileManagerProps', fileManagerProps)
0 commit comments