mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-22 01:53:33 +00:00
🐛 fix: delegate findPubliclyAccessibleResources to fixed DB method
`AccessControlService.findPubliclyAccessibleResources` inlined the same `$bitsAllSet` query as the data-schemas layer, which fails on Azure Cosmos DB for MongoDB. Delegate to `_dbMethods.findPublicResourceIds` so a single implementation carries the Cosmos-compatible bitwise logic. Refs #12729.
This commit is contained in:
parent
a35ea241f5
commit
da5f6a8b2f
1 changed files with 1 additions and 10 deletions
|
|
@ -174,16 +174,7 @@ export class AccessControlService {
|
|||
|
||||
this.validateResourceType(resourceType);
|
||||
|
||||
// Find all public ACL entries where the public principal has at least the required permission bits
|
||||
const entries = await this._aclModel
|
||||
.find({
|
||||
principalType: PrincipalType.PUBLIC,
|
||||
resourceType,
|
||||
permBits: { $bitsAllSet: requiredPermissions },
|
||||
})
|
||||
.distinct('resourceId');
|
||||
|
||||
return entries;
|
||||
return await this._dbMethods.findPublicResourceIds(resourceType, requiredPermissions);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
logger.error(`[PermissionService.findPubliclyAccessibleResources] Error: ${error.message}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue