Skip to content

Replace getAdapter(context, ISecuritySchema) with registry.forInterface#2011

Open
jensens wants to merge 1 commit intomainfrom
fix/replace-bbb-getadapter
Open

Replace getAdapter(context, ISecuritySchema) with registry.forInterface#2011
jensens wants to merge 1 commit intomainfrom
fix/replace-bbb-getadapter

Conversation

@jensens
Copy link
Copy Markdown
Member

@jensens jensens commented Mar 29, 2026

Summary

  • Replace getAdapter(context, ISecuritySchema) with registry.forInterface(ISecuritySchema, prefix="plone") in user add/update services and tests
  • This removes the adapter indirection layer for accessing security settings, reading directly from the registry instead
  • Part of the broader effort to remove BBB adapter lookups: plone/Products.CMFPlone#1050

Changes

  • services/users/add.py: Two call sites updated, getAdapter import replaced with getUtility
  • services/users/update.py: One call site updated, getAdapter import replaced with getUtility
  • tests/test_services_users.py: All 23 occurrences updated, getAdapter import removed (getUtility was already imported)

Test plan

  • Existing user service tests pass (they exercise all changed code paths)
  • CI green

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://plonerestapi--2011.org.readthedocs.build/

Use registry.forInterface(ISecuritySchema, prefix="plone") instead of
the BBB adapter lookup via getAdapter. This accesses the registry
directly, avoiding the adapter indirection layer.
@mister-roboto
Copy link
Copy Markdown

@jensens thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@jensens
Copy link
Copy Markdown
Member Author

jensens commented Mar 29, 2026

@jenkins-plone-org please run jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants