mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-07 08:40:19 +01:00
🛡️ fix: Add Permission Guard for Temporary Chat Visibility (#12107)
- Add useHasAccess hook for TEMPORARY_CHAT permission type - Conditionally render TemporaryChat component based on user permissions - Ensures feature respects role-based access control Co-authored-by: Airam Hernández Hernández <airam.hernandez@intelequia.com>
This commit is contained in:
parent
3a73907daa
commit
cc3d62c640
1 changed files with 7 additions and 2 deletions
|
|
@ -35,6 +35,11 @@ function Header() {
|
|||
permission: Permissions.USE,
|
||||
});
|
||||
|
||||
const hasAccessToTemporaryChat = useHasAccess({
|
||||
permissionType: PermissionTypes.TEMPORARY_CHAT,
|
||||
permission: Permissions.USE,
|
||||
});
|
||||
|
||||
const isSmallScreen = useMediaQuery('(max-width: 768px)');
|
||||
|
||||
return (
|
||||
|
|
@ -73,7 +78,7 @@ function Header() {
|
|||
<ExportAndShareMenu
|
||||
isSharedButtonEnabled={startupConfig?.sharedLinksEnabled ?? false}
|
||||
/>
|
||||
<TemporaryChat />
|
||||
{hasAccessToTemporaryChat === true && <TemporaryChat />}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -85,7 +90,7 @@ function Header() {
|
|||
<ExportAndShareMenu
|
||||
isSharedButtonEnabled={startupConfig?.sharedLinksEnabled ?? false}
|
||||
/>
|
||||
<TemporaryChat />
|
||||
{hasAccessToTemporaryChat === true && <TemporaryChat />}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue