fix(homepage): fix conditional permission checks and use props from default config widgets also when customization is enabled#3231
Conversation
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Code Review by Qodo
1.
|
Changed Packages
|
Review Summary by QodoImplement conditional permission checks for homepage default widgets
WalkthroughsDescription• Migrate from simple ALLOW/DENY decisions to conditional policy decisions • Update permission checks to support conditional criteria evaluation • Refactor permission resource type from VisibleDefaultWidget to DefaultWidgetNode • Add conditional policies configuration and permission rules matching logic • Update app configurations for RBAC and conditional policies support Diagramflowchart LR
A["buildUserContext"] -->|"authorizeConditional"| B["PolicyDecision"]
B -->|"ALLOW/CONDITIONAL"| C["evaluateVisibility"]
C -->|"matches conditions"| D["Permission Rules"]
D -->|"HAS_WIDGET_ID"| E["Filtered Widgets"]
File Changes1. workspaces/homepage/plugins/homepage-backend/src/defaultWidgets/buildUserContext.ts
|
291231f to
23c33ca
Compare
…sion checks Migrate tests from simple permissionDecisions (string values) to policyDecisions (PolicyDecision objects) and fix isVisible tests to pass DefaultWidgetNode with `if` field. Add tests for CONDITIONAL decisions covering allOf, anyOf, not, and unknown rule cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3231 +/- ##
=======================================
Coverage 53.82% 53.83%
=======================================
Files 2362 2363 +1
Lines 84815 84854 +39
Branches 23508 23520 +12
=======================================
+ Hits 45650 45678 +28
- Misses 37714 37725 +11
Partials 1451 1451
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
23c33ca to
c173028
Compare
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
4a97c97 to
aa8477a
Compare
|



Hey, I just made a Pull Request!
todo: add some test cases and some documentation here
✔️ Checklist