mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-17 16:08:10 +01:00
✨ feat: Add Group Access Control to Model Specifications and Update User Filtering Logic
This commit is contained in:
parent
dd762f7223
commit
e8702e104d
3 changed files with 36 additions and 12 deletions
|
|
@ -19,6 +19,9 @@ export type TModelSpec = {
|
|||
showIconInHeader?: boolean;
|
||||
iconURL?: string | EModelEndpoint; // Allow using project-included icons
|
||||
authType?: AuthType;
|
||||
groups?: Array<string>; // List of group ObjectIds allowed to access this model
|
||||
// badgeIcon?: string; // URL to badge icon for visual categorization
|
||||
// badgeTooltip?: string; // Tooltip text for the badge
|
||||
};
|
||||
|
||||
export const tModelSpecSchema = z.object({
|
||||
|
|
@ -32,6 +35,9 @@ export const tModelSpecSchema = z.object({
|
|||
showIconInHeader: z.boolean().optional(),
|
||||
iconURL: z.union([z.string(), eModelEndpointSchema]).optional(),
|
||||
authType: authTypeSchema.optional(),
|
||||
groups: z.array(z.string()).optional(),
|
||||
// badgeIcon: z.string().url('Must be a valid URL').optional(),
|
||||
// badgeTooltip: z.string().optional(),
|
||||
});
|
||||
|
||||
export const specsConfigSchema = z.object({
|
||||
|
|
|
|||
|
|
@ -106,6 +106,16 @@ export type TBackupCode = {
|
|||
usedAt: Date | null;
|
||||
};
|
||||
|
||||
export type TGroup = {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
externalId?: string;
|
||||
provider: 'local' | 'openid';
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
};
|
||||
|
||||
export type TUser = {
|
||||
id: string;
|
||||
username: string;
|
||||
|
|
@ -116,6 +126,7 @@ export type TUser = {
|
|||
provider: string;
|
||||
plugins?: string[];
|
||||
backupCodes?: TBackupCode[];
|
||||
groups: string[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue