File tree Expand file tree Collapse file tree
packages/plugins/plugin-security/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,10 @@ export class RLSCompiler {
9393 return { [ field ] : { $in : value } } ;
9494 }
9595
96- // Unsupported expression: return null (no filter applied - fail-safe is to deny)
96+ // Unsupported expression: return null (no additional RLS filter applied).
97+ // Note: callers should treat absence of RLS policies as "allow all" only when
98+ // no policies are defined. If policies exist but cannot be compiled, the caller
99+ // may want to deny access as a safety measure.
97100 return null ;
98101 }
99102
Original file line number Diff line number Diff line change @@ -76,7 +76,14 @@ export class SecurityPlugin implements Plugin {
7676 }
7777
7878 // 1. Resolve permission sets for the user's roles
79- const permissionSets : PermissionSet [ ] = this . permissionEvaluator . resolvePermissionSets ( roles , metadata ) ;
79+ let permissionSets : PermissionSet [ ] = [ ] ;
80+ try {
81+ permissionSets = this . permissionEvaluator . resolvePermissionSets ( roles , metadata ) ;
82+ } catch ( e ) {
83+ // If metadata service is misconfigured, log and continue without permission checks
84+ // rather than blocking all operations
85+ return next ( ) ;
86+ }
8087
8188 // 2. CRUD permission check
8289 if ( permissionSets . length > 0 ) {
You can’t perform that action at this time.
0 commit comments