Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22469, XWIKI-22471 and XWIKI-22461: add missing required right analyzers and refactor required right analyzers #3771

Closed

Conversation

michitux
Copy link
Contributor

@michitux michitux commented Dec 18, 2024

Jira URL

Changes

Description

  • Refactor object required right analyzers and adapt the code introduced in XWIKI-22470 (unreleased) to use the new classes.
  • Introduce missing required right analyzers for XWiki.Notifications.Code.NotificationFilterDisplayerClass, XWiki.Notifications.Code.NotificationEmailRendererClass, and XWiki.EventStream.Code.EventClass.

Clarifications

  • The refactoring is to reduce code duplication in the different analyzers. For most of the existing unit tests, I chose to keep them mostly unmodified and thereby verify that the new helper component keeps the behavior unmodified.
  • I chose to provide everything in one PR as the main part is the big refactoring and then the individual analyzers are trivially small.

Screenshots & Video

This adds new required right warnings, they are very similar to existing ones just with new messages:

grafik

Executed Tests

LANG=C.UTF-8 mvn clean install -Pdocker,legacy,integration-tests,snapshotModules,quality -pl :xwiki-platform-eventstream-default,:xwiki-platform-notifications-filters-default,:xwiki-platform-notifications-notifiers-default,:xwiki-platform-security-requiredrights-default

Expected merging strategy

  • Prefers squash: No, the individual commits need to stay separate as they target different issues
  • Backport on branches:
    • stable-16.10.x
    • stable-16.4.x
    • stable-15.10.x

…rights analyzer

* Add a required rights analyzer for XWiki.EventStream.Code.EventClass.
* Add a unit test.
* Replace duplicated string literals across classes by constants.
…ode.NotificationDisplayerClass

* Simplify the code by using ObjectPropertyRequiredRightAnalyzer.
…ode.NotificationDisplayerClass

* Add missing since-versions.
@michitux michitux force-pushed the object-required-right-analyzers branch from 40c2e65 to b690078 Compare December 18, 2024 16:12
@michitux
Copy link
Contributor Author

Merged manually.

@michitux michitux closed this Dec 18, 2024
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