mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-14 22:48:10 +01:00
* 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.
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
const mongoose = require('mongoose');
|
|
const { logger } = require('@librechat/data-schemas');
|
|
const {
|
|
logAgentMigrationWarning,
|
|
logPromptMigrationWarning,
|
|
checkAgentPermissionsMigration,
|
|
checkPromptPermissionsMigration,
|
|
} = require('@librechat/api');
|
|
const { Agent, PromptGroup } = require('~/db/models');
|
|
const { findRoleByIdentifier } = require('~/models');
|
|
|
|
/**
|
|
* Check if permissions migrations are needed for shared resources
|
|
* This runs at the end to ensure all systems are initialized
|
|
*/
|
|
async function checkMigrations() {
|
|
try {
|
|
const agentMigrationResult = await checkAgentPermissionsMigration({
|
|
mongoose,
|
|
methods: {
|
|
findRoleByIdentifier,
|
|
},
|
|
AgentModel: Agent,
|
|
});
|
|
logAgentMigrationWarning(agentMigrationResult);
|
|
} catch (error) {
|
|
logger.error('Failed to check agent permissions migration:', error);
|
|
}
|
|
try {
|
|
const promptMigrationResult = await checkPromptPermissionsMigration({
|
|
mongoose,
|
|
methods: {
|
|
findRoleByIdentifier,
|
|
},
|
|
PromptGroupModel: PromptGroup,
|
|
});
|
|
logPromptMigrationWarning(promptMigrationResult);
|
|
} catch (error) {
|
|
logger.error('Failed to check prompt permissions migration:', error);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
checkMigrations,
|
|
};
|