mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
fix: frontend permission check (#784)
This commit is contained in:
@@ -8,6 +8,7 @@ import Indicator from '../indicator'
|
||||
import type { AppDetailResponse } from '@/models/app'
|
||||
import NewAppDialog from '@/app/(commonLayout)/apps/NewAppDialog'
|
||||
import AppIcon from '@/app/components/base/app-icon'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
|
||||
type IAppSelectorProps = {
|
||||
appItems: AppDetailResponse[]
|
||||
@@ -16,6 +17,7 @@ type IAppSelectorProps = {
|
||||
|
||||
export default function AppSelector({ appItems, curApp }: IAppSelectorProps) {
|
||||
const router = useRouter()
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
const [showNewAppDialog, setShowNewAppDialog] = useState(false)
|
||||
const { t } = useTranslation()
|
||||
|
||||
@@ -77,7 +79,7 @@ export default function AppSelector({ appItems, curApp }: IAppSelectorProps) {
|
||||
))
|
||||
}
|
||||
</div>)}
|
||||
<Menu.Item>
|
||||
{isCurrentWorkspaceManager && <Menu.Item>
|
||||
<div className='p-1' onClick={() => setShowNewAppDialog(true)}>
|
||||
<div
|
||||
className='flex items-center h-12 rounded-lg cursor-pointer hover:bg-gray-100'
|
||||
@@ -95,6 +97,7 @@ export default function AppSelector({ appItems, curApp }: IAppSelectorProps) {
|
||||
</div>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
}
|
||||
</Menu.Items>
|
||||
</Transition>
|
||||
</Menu>
|
||||
|
||||
Reference in New Issue
Block a user