🗂️ feat: Add File Search Toggle Permission for Chat Area Badge (#8605)

This commit is contained in:
Danny Avila 2025-07-22 17:51:21 -04:00 committed by GitHub
parent 5178507b1c
commit e5d08ccdf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 184 additions and 19 deletions

View file

@ -72,6 +72,11 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
permission: Permissions.USE,
});
const canUseFileSearch = useHasAccess({
permissionType: PermissionTypes.FILE_SEARCH,
permission: Permissions.USE,
});
const showWebSearchSettings = useMemo(() => {
const authTypes = webSearchAuthData?.authTypes ?? [];
if (authTypes.length === 0) return true;
@ -140,7 +145,7 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
const dropdownItems: MenuItemProps[] = [];
if (fileSearchEnabled) {
if (fileSearchEnabled && canUseFileSearch) {
dropdownItems.push({
onClick: handleFileSearchToggle,
hideOnClick: false,