mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-19 08:58:09 +01:00
🗑️ chore: Remove Deprecated Project Model and Associated Fields (#11773)
* chore: remove projects and projectIds usage * chore: empty line linting * chore: remove isCollaborative property across agent models and related tests - Removed the isCollaborative property from agent models, controllers, and tests, as it is deprecated in favor of ACL permissions. - Updated related validation schemas and data provider types to reflect this change. - Ensured all references to isCollaborative were stripped from the codebase to maintain consistency and clarity.
This commit is contained in:
parent
fde687ff19
commit
a85e99ff45
41 changed files with 94 additions and 821 deletions
|
|
@ -216,17 +216,12 @@ describe('access middleware', () => {
|
|||
|
||||
defaultParams.getRoleByName.mockResolvedValue(mockRole);
|
||||
|
||||
const checkObject = {
|
||||
projectIds: ['project1'],
|
||||
removeProjectIds: ['project2'],
|
||||
};
|
||||
const checkObject = {};
|
||||
|
||||
const result = await checkAccess({
|
||||
...defaultParams,
|
||||
permissions: [Permissions.USE, Permissions.SHARE],
|
||||
bodyProps: {
|
||||
[Permissions.SHARE]: ['projectIds', 'removeProjectIds'],
|
||||
} as Record<Permissions, string[]>,
|
||||
bodyProps: {} as Record<Permissions, string[]>,
|
||||
checkObject,
|
||||
});
|
||||
expect(result).toBe(true);
|
||||
|
|
@ -244,17 +239,12 @@ describe('access middleware', () => {
|
|||
|
||||
defaultParams.getRoleByName.mockResolvedValue(mockRole);
|
||||
|
||||
const checkObject = {
|
||||
projectIds: ['project1'],
|
||||
// missing removeProjectIds
|
||||
};
|
||||
const checkObject = {};
|
||||
|
||||
const result = await checkAccess({
|
||||
...defaultParams,
|
||||
permissions: [Permissions.SHARE],
|
||||
bodyProps: {
|
||||
[Permissions.SHARE]: ['projectIds', 'removeProjectIds'],
|
||||
} as Record<Permissions, string[]>,
|
||||
bodyProps: {} as Record<Permissions, string[]>,
|
||||
checkObject,
|
||||
});
|
||||
expect(result).toBe(false);
|
||||
|
|
@ -343,17 +333,12 @@ describe('access middleware', () => {
|
|||
} as unknown as IRole;
|
||||
|
||||
mockGetRoleByName.mockResolvedValue(mockRole);
|
||||
mockReq.body = {
|
||||
projectIds: ['project1'],
|
||||
removeProjectIds: ['project2'],
|
||||
};
|
||||
mockReq.body = {};
|
||||
|
||||
const middleware = generateCheckAccess({
|
||||
permissionType: PermissionTypes.AGENTS,
|
||||
permissions: [Permissions.USE, Permissions.CREATE, Permissions.SHARE],
|
||||
bodyProps: {
|
||||
[Permissions.SHARE]: ['projectIds', 'removeProjectIds'],
|
||||
} as Record<Permissions, string[]>,
|
||||
bodyProps: {} as Record<Permissions, string[]>,
|
||||
getRoleByName: mockGetRoleByName,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue