musora-content-services 2.94.5 → 2.94.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.94.6](https://github.com/railroadmedia/musora-content-services/compare/v2.94.5...v2.94.6) (2025-12-03)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Patch permissions filter (round 2) ([#616](https://github.com/railroadmedia/musora-content-services/issues/616)) ([f8509a5](https://github.com/railroadmedia/musora-content-services/commit/f8509a5178dfdd17ac06f5779a39960ae1a8130b))
11
+
5
12
  ### [2.94.5](https://github.com/railroadmedia/musora-content-services/compare/v2.94.4...v2.94.5) (2025-12-03)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musora-content-services",
3
- "version": "2.94.5",
3
+ "version": "2.94.6",
4
4
  "description": "A package for Musoras content services ",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -178,7 +178,7 @@ export class PermissionsV2Adapter extends PermissionsAdapter {
178
178
 
179
179
  // Content with no permissions is accessible to all
180
180
  // A content has "no permissions" if BOTH permission and permission_v2 are empty/undefined
181
- clauses.push(`((!defined(${prefix}permission) || count(${prefix}permission) == 0) && (!defined(${prefix}permission_v2) || count(${prefix}permission_v2) == 0))`)
181
+ clauses.push(`(!defined(${prefix}permission_v2) || count(${prefix}permission_v2) == 0)`)
182
182
 
183
183
  // User has matching permissions
184
184
  if (userPermissionIds.length > 0) {
@@ -204,12 +204,10 @@ export class PermissionsV2Adapter extends PermissionsAdapter {
204
204
  ): string {
205
205
  if (isDereferencedContext) {
206
206
  // In dereferenced context, check the permission array directly
207
- return `((count((${prefix}permission[]._ref)[@ in *[_type == 'permission' && railcontent_id in ${arrayToRawRepresentation(permissions)}]._id]) > 0)
208
- || count(array::intersects(${prefix}permission_v2, ${arrayToRawRepresentation(permissions)})) > 0)`
207
+ return `array::intersects(${prefix}permission_v2, ${arrayToRawRepresentation(permissions)})`
209
208
  }
210
209
  // In standard context, use references() function
211
- return `(references(*[_type == 'permission' && railcontent_id in ${arrayToRawRepresentation(permissions)}]._id) ||
212
- count(array::intersects(permission_v2, ${arrayToRawRepresentation(permissions)})) > 0)`
210
+ return `array::intersects(permission_v2, ${arrayToRawRepresentation(permissions)})`
213
211
  }
214
212
 
215
213
  /**