mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 18:58:35 +08:00
34 lines
977 B
TypeScript
34 lines
977 B
TypeScript
import type { AccessControlGroup } from '@/models/access-control'
|
|
import {
|
|
useAppWhiteListSubjects as useAppWhiteListSubjectsBase,
|
|
useGetUserCanAccessApp as useGetUserCanAccessAppBase,
|
|
useSearchForWhiteListCandidates as useSearchForWhiteListCandidatesBase,
|
|
} from './use-app-access-control'
|
|
|
|
type SearchForWhiteListCandidatesQuery = {
|
|
keyword?: string
|
|
groupId?: AccessControlGroup['id']
|
|
resultsPerPage?: number
|
|
}
|
|
|
|
type UserCanAccessAppParams = {
|
|
appId?: string
|
|
isInstalledApp?: boolean
|
|
enabled?: boolean
|
|
}
|
|
|
|
export const useAppWhiteListSubjects = (appId: string | undefined, enabled: boolean) => {
|
|
return useAppWhiteListSubjectsBase(appId, enabled)
|
|
}
|
|
|
|
export const useSearchForWhiteListCandidates = (
|
|
query: SearchForWhiteListCandidatesQuery,
|
|
enabled: boolean,
|
|
) => {
|
|
return useSearchForWhiteListCandidatesBase(query, enabled)
|
|
}
|
|
|
|
export const useGetUserCanAccessApp = (params: UserCanAccessAppParams) => {
|
|
return useGetUserCanAccessAppBase(params)
|
|
}
|