mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
🧹 feat: Automatic File Cleanup for Mistral OCR Uploads (#8827)
* chore: Handle optional token_endpoint in OAuth metadata discovery * chore: Simplify permission typing logic in checkAccess function * feat: Implement `deleteMistralFile` function and integrate file cleanup in `uploadMistralOCR`
This commit is contained in:
parent
7ef2c626e2
commit
33834cd484
4 changed files with 438 additions and 12 deletions
|
|
@ -63,13 +63,10 @@ export const checkAccess = async ({
|
|||
}
|
||||
|
||||
const role = await getRoleByName(user.role);
|
||||
if (role && role.permissions && role.permissions[permissionType]) {
|
||||
const permissionValue = role?.permissions?.[permissionType as keyof typeof role.permissions];
|
||||
if (role && role.permissions && permissionValue) {
|
||||
const hasAnyPermission = permissions.every((permission) => {
|
||||
if (
|
||||
role.permissions?.[permissionType as keyof typeof role.permissions]?.[
|
||||
permission as keyof (typeof role.permissions)[typeof permissionType]
|
||||
]
|
||||
) {
|
||||
if (permissionValue[permission as keyof typeof permissionValue]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue