expand user permissions
This commit is contained in:
@@ -13,6 +13,7 @@ interface Props {
|
||||
libraryId: string
|
||||
libraryName: string
|
||||
initialPath: string
|
||||
readOnly?: boolean
|
||||
}
|
||||
|
||||
type ModalState =
|
||||
@@ -22,7 +23,7 @@ type ModalState =
|
||||
|
||||
type TagPanelState = { entry: FileEntry; itemKey: string } | null
|
||||
|
||||
export default function MixedView({ libraryId, libraryName, initialPath }: Props) {
|
||||
export default function MixedView({ libraryId, libraryName, initialPath, readOnly }: Props) {
|
||||
const [currentPath, setCurrentPath] = useState(initialPath)
|
||||
const [listing, setListing] = useState<DirectoryListing | null>(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
@@ -550,7 +551,8 @@ export default function MixedView({ libraryId, libraryName, initialPath }: Props
|
||||
onNext={modal.mediaIndex < mediaEntries.length - 1 ? () => navigateModal(1) : undefined}
|
||||
showTags={modalShowTags}
|
||||
onShowTagsChange={setModalShowTags}
|
||||
onAiTag={modal.itemKey ? async () => {
|
||||
readOnly={readOnly}
|
||||
onAiTag={!readOnly && modal.itemKey ? async () => {
|
||||
const res = await fetch('/api/ai-tagging', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@@ -576,7 +578,8 @@ export default function MixedView({ libraryId, libraryName, initialPath }: Props
|
||||
onNext={modal.mediaIndex < mediaEntries.length - 1 ? () => navigateModal(1) : undefined}
|
||||
showTags={modalShowTags}
|
||||
onShowTagsChange={setModalShowTags}
|
||||
onAiTag={async () => {
|
||||
readOnly={readOnly}
|
||||
onAiTag={readOnly ? undefined : async () => {
|
||||
const res = await fetch('/api/ai-tagging', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
||||
Reference in New Issue
Block a user