feat: add option to skip rbac - #388
Conversation
2 new issues
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (4)
🛟 Help
|
|
Reviewed against the agent-nodejs#1879 port — solid overall (direct-collection auth stays enforced, boot-safe default, frontend contract matches). One point worth a look before merge:
Minor: the subclass-singleton rationale comment is duplicated verbatim across |
|
Test proving the shared-flag issue above — currently red ( describe '#setup' do
# Agent < AgentFactory: Ruby's Singleton gives each class its own #instance, so the main
# agent and this one never share an object — but #setup writes skip_relation_read_permissions
# onto Services::Permissions, a single class shared by the whole process. A host running
# both in one process (e.g. this gem alongside forest_admin_rails, as the demo example app
# does) has whichever #setup ran last decide the setting for both agents, silently.
after { ForestAdminAgent::Services::Permissions.skip_relation_read_permissions = false }
let(:options) do
{
auth_secret: 'cba803d01a4d43b55010cab41fa1ea1f1f51a95e',
env_secret: '89719c6d8e2e2de2694c2f220fe2dbf02d5289487364daf1e4c6b13733ed0cdb',
is_production: false
}
end
it 'does not let this agent override the main agent skip_relation_read_permissions setting' do
ForestAdminAgent::Builder::AgentFactory.instance.setup(options.merge(skip_relation_read_permissions: false))
expect(ForestAdminAgent::Services::Permissions.skip_relation_read_permissions?).to be false
instance.setup(options.merge(skip_relation_read_permissions: true))
expect(ForestAdminAgent::Services::Permissions.skip_relation_read_permissions?).to be false
end
endDrops into |
matthv
left a comment
There was a problem hiding this comment.
Ok for me.
You have to move the method skip_relation_read_permissions before or after audit_trail_enabled?
# [1.43.0](v1.42.0...v1.43.0) (2026-09-10) ### Features * add option to skip rbac ([#388](#388)) ([3894104](3894104))
|
🎉 This PR is included in version 1.43.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

Definition of Done
General
Security
Note
Add
skip_relation_read_permissionsoption to bypass relation-read checksskip_relation_read_permissionsconfig setting (defaultfalse) toForestAdminRails,ForestAdminRpcAgent, and the agent setup options.true,Permissions#read_permissionsreturns all non-root collections as readable without fetching permission data, andassert_extended_search_checkableno longer refuses extended searches whose reached fields cannot be determined.browsepermission check, and the capabilities payload reportschecksRelationReadPermissions: false.AgentFactorylogs aWarn-level message at boot when the option is enabled.browsechecks inpermission_allowed?are unaffected.Changes since #388 opened
ForestAdminAgent::Routes::Capabilities::Collectionsclass [ef511d4]Macroscope summarized 4db058b.