mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
🗂️ feat: Add File Search Toggle Permission for Chat Area Badge (#8605)
This commit is contained in:
parent
5178507b1c
commit
e5d08ccdf1
11 changed files with 184 additions and 19 deletions
|
|
@ -2,7 +2,9 @@ import { Schema } from 'mongoose';
|
|||
import { PermissionTypes, Permissions } from 'librechat-data-provider';
|
||||
import type { IRole } from '~/types';
|
||||
|
||||
// Create a sub-schema for permissions. Notice we disable _id for this subdocument.
|
||||
/**
|
||||
* Uses a sub-schema for permissions. Notice we disable `_id` for this subdocument.
|
||||
*/
|
||||
const rolePermissionsSchema = new Schema(
|
||||
{
|
||||
[PermissionTypes.BOOKMARKS]: {
|
||||
|
|
@ -37,6 +39,9 @@ const rolePermissionsSchema = new Schema(
|
|||
[PermissionTypes.WEB_SEARCH]: {
|
||||
[Permissions.USE]: { type: Boolean, default: true },
|
||||
},
|
||||
[PermissionTypes.FILE_SEARCH]: {
|
||||
[Permissions.USE]: { type: Boolean, default: true },
|
||||
},
|
||||
},
|
||||
{ _id: false },
|
||||
);
|
||||
|
|
@ -67,6 +72,7 @@ const roleSchema: Schema<IRole> = new Schema({
|
|||
[PermissionTypes.TEMPORARY_CHAT]: { [Permissions.USE]: true },
|
||||
[PermissionTypes.RUN_CODE]: { [Permissions.USE]: true },
|
||||
[PermissionTypes.WEB_SEARCH]: { [Permissions.USE]: true },
|
||||
[PermissionTypes.FILE_SEARCH]: { [Permissions.USE]: true },
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue