mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-12 12:34:24 +01:00
feat: Enhance people picker access control to include roles permissions
This commit is contained in:
parent
9403613ef2
commit
82047d9416
7 changed files with 457 additions and 22 deletions
|
|
@ -538,12 +538,14 @@ export const interfaceSchema = z
|
|||
.object({
|
||||
users: z.boolean().optional(),
|
||||
groups: z.boolean().optional(),
|
||||
roles: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
user: z
|
||||
.object({
|
||||
users: z.boolean().optional(),
|
||||
groups: z.boolean().optional(),
|
||||
roles: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
|
@ -583,10 +585,12 @@ export const interfaceSchema = z
|
|||
admin: {
|
||||
users: true,
|
||||
groups: true,
|
||||
roles: true,
|
||||
},
|
||||
user: {
|
||||
users: false,
|
||||
groups: false,
|
||||
roles: false,
|
||||
},
|
||||
},
|
||||
marketplace: {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export enum Permissions {
|
|||
OPT_OUT = 'OPT_OUT',
|
||||
VIEW_USERS = 'VIEW_USERS',
|
||||
VIEW_GROUPS = 'VIEW_GROUPS',
|
||||
VIEW_ROLES = 'VIEW_ROLES',
|
||||
}
|
||||
|
||||
export const promptPermissionsSchema = z.object({
|
||||
|
|
@ -124,6 +125,7 @@ export type TWebSearchPermissions = z.infer<typeof webSearchPermissionsSchema>;
|
|||
export const peoplePickerPermissionsSchema = z.object({
|
||||
[Permissions.VIEW_USERS]: z.boolean().default(true),
|
||||
[Permissions.VIEW_GROUPS]: z.boolean().default(true),
|
||||
[Permissions.VIEW_ROLES]: z.boolean().default(true),
|
||||
});
|
||||
export type TPeoplePickerPermissions = z.infer<typeof peoplePickerPermissionsSchema>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue