mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
🧑🤝🧑 feat: Add People Picker Permissions Management UI
This commit is contained in:
parent
d82a63642d
commit
a434d28579
15 changed files with 419 additions and 229 deletions
|
@ -275,6 +275,8 @@ export const getRole = (roleName: string) => `${roles()}/${roleName.toLowerCase(
|
|||
export const updatePromptPermissions = (roleName: string) => `${getRole(roleName)}/prompts`;
|
||||
export const updateMemoryPermissions = (roleName: string) => `${getRole(roleName)}/memories`;
|
||||
export const updateAgentPermissions = (roleName: string) => `${getRole(roleName)}/agents`;
|
||||
export const updatePeoplePickerPermissions = (roleName: string) =>
|
||||
`${getRole(roleName)}/people-picker`;
|
||||
|
||||
/* Conversation Tags */
|
||||
export const conversationTags = (tag?: string) =>
|
||||
|
|
|
@ -534,20 +534,9 @@ export const interfaceSchema = z
|
|||
webSearch: z.boolean().optional(),
|
||||
peoplePicker: z
|
||||
.object({
|
||||
admin: 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(),
|
||||
users: z.boolean().optional(),
|
||||
groups: z.boolean().optional(),
|
||||
roles: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
marketplace: z
|
||||
|
@ -582,16 +571,9 @@ export const interfaceSchema = z
|
|||
runCode: true,
|
||||
webSearch: true,
|
||||
peoplePicker: {
|
||||
admin: {
|
||||
users: true,
|
||||
groups: true,
|
||||
roles: true,
|
||||
},
|
||||
user: {
|
||||
users: false,
|
||||
groups: false,
|
||||
roles: false,
|
||||
},
|
||||
users: true,
|
||||
groups: true,
|
||||
roles: true,
|
||||
},
|
||||
marketplace: {
|
||||
admin: {
|
||||
|
|
|
@ -791,6 +791,15 @@ export function updateMemoryPermissions(
|
|||
return request.put(endpoints.updateMemoryPermissions(variables.roleName), variables.updates);
|
||||
}
|
||||
|
||||
export function updatePeoplePickerPermissions(
|
||||
variables: m.UpdatePeoplePickerPermVars,
|
||||
): Promise<m.UpdatePermResponse> {
|
||||
return request.put(
|
||||
endpoints.updatePeoplePickerPermissions(variables.roleName),
|
||||
variables.updates,
|
||||
);
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
export function getConversationTags(): Promise<t.TConversationTagsResponse> {
|
||||
return request.get(endpoints.conversationTags());
|
||||
|
|
|
@ -273,6 +273,7 @@ export type UpdatePermVars<T> = {
|
|||
export type UpdatePromptPermVars = UpdatePermVars<p.TPromptPermissions>;
|
||||
export type UpdateMemoryPermVars = UpdatePermVars<p.TMemoryPermissions>;
|
||||
export type UpdateAgentPermVars = UpdatePermVars<p.TAgentPermissions>;
|
||||
export type UpdatePeoplePickerPermVars = UpdatePermVars<p.TPeoplePickerPermissions>;
|
||||
|
||||
export type UpdatePermResponse = r.TRole;
|
||||
|
||||
|
@ -297,6 +298,13 @@ export type UpdateAgentPermOptions = MutationOptions<
|
|||
types.TError | null | undefined
|
||||
>;
|
||||
|
||||
export type UpdatePeoplePickerPermOptions = MutationOptions<
|
||||
UpdatePermResponse,
|
||||
UpdatePeoplePickerPermVars,
|
||||
unknown,
|
||||
types.TError | null | undefined
|
||||
>;
|
||||
|
||||
export type UpdateConversationTagOptions = MutationOptions<
|
||||
types.TConversationTag,
|
||||
types.TConversationTagRequest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue