🐛 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:
Danny Avila 2026-04-18 10:33:09 -04:00
parent a35ea241f5
commit da5f6a8b2f

View file

@ -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}`);