mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
* fix: remove duplicate keys in German language translations * wip: multi-convo role permissions * ci: Update loadDefaultInterface tests due to MULTI_CONVO * ci: update Role.spec.js with tests for MULTI_CONVO permission type * fix: Update ContentParts component to handle undefined content array * feat: render Multi-Convo based on UI permissions
55 lines
1.1 KiB
JavaScript
55 lines
1.1 KiB
JavaScript
const { PermissionTypes, Permissions } = require('librechat-data-provider');
|
|
const mongoose = require('mongoose');
|
|
|
|
const roleSchema = new mongoose.Schema({
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
unique: true,
|
|
index: true,
|
|
},
|
|
[PermissionTypes.BOOKMARKS]: {
|
|
[Permissions.USE]: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
[PermissionTypes.PROMPTS]: {
|
|
[Permissions.SHARED_GLOBAL]: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
[Permissions.USE]: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
[Permissions.CREATE]: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
[PermissionTypes.AGENTS]: {
|
|
[Permissions.SHARED_GLOBAL]: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
[Permissions.USE]: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
[Permissions.CREATE]: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
[PermissionTypes.MULTI_CONVO]: {
|
|
[Permissions.USE]: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
});
|
|
|
|
const Role = mongoose.model('Role', roleSchema);
|
|
|
|
module.exports = Role;
|