Skip to content

fix(RHCLOUD-50680): preserve Kessel permissions for v2 org admins - #1517

Merged
aferd merged 1 commit into
RedHatInsights:masterfrom
aferd:fix/RHCLOUD-50680-v2-org-admin-integrations-permissions
Aug 25, 2026
Merged

aferd merged 1 commit into
RedHatInsights:masterfrom
aferd:fix/RHCLOUD-50680-v2-org-admin-integrations-permissions

Conversation

@aferd

@aferd aferd commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • v2 org admins were not getting proper permissions to create integrations
  • The v1 fallback's PENDING action in the reducer was resetting integrationsEndpointsPermissions and integrationsReadPermissions to undefined, wiping Kessel-granted permissions that were just set synchronously
  • Fixed the pending handlers to preserve already-granted (true) permissions using state.integrationsEndpointsPermissions || undefined

Root cause

In PermissionsChecker, when Kessel is enabled, loadPermissionsFromKessel dispatches FULFILLED synchronously (setting permissions to true), then loadIntegrationsEndpointsPermissions (v1 fallback) immediately dispatches PENDING synchronously — resetting the state to undefined and destroying the Kessel result.

Test plan

  • Verify v2 org admin can see the "Create Integration" button enabled
  • Verify v2 org admin can create Communications, Reporting, and Webhook integrations
  • Verify v1 org admin permissions still work correctly
  • Verify non-admin users still see proper disabled state
  • Existing unit tests pass (npx jest --testPathPattern="redux/user")

Resolves: https://redhat.atlassian.net/browse/RHCLOUD-50680

🤖 Generated with Claude Code

The v1 fallback PENDING action was resetting integrationsEndpointsPermissions
and integrationsReadPermissions to undefined, wiping Kessel-granted permissions
for v2 org admins. Preserve already-granted permissions in pending handlers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aferd
aferd requested a review from a team as a code owner August 25, 2026 15:05
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: aaef9089-8cef-4bc9-a096-19ebf990270b

📥 Commits

Reviewing files that changed from the base of the PR and between fbdb242 and 38dd2b1.

📒 Files selected for processing (1)
  • src/redux/user/reducer.js

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Preserved existing permission settings when processing integration endpoint and read-permission updates.
    • Prevented valid permissions from being unintentionally cleared during pending operations.

Walkthrough

The user reducer now preserves existing truthy integration endpoint and read permission values during pending actions. It falls back to undefined when no permission value exists.

Changes

User permission state

Layer / File(s) Summary
Preserve pending permission values
src/redux/user/reducer.js
Pending handlers for integration endpoint and read permissions retain existing truthy values instead of clearing them. They use undefined when no value exists.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 38dd2

This localized change preserves permissions already granted to v2 organization administrators while allowing the fallback permission flow to continue; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: apinkert

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the permission fix for v2 organization administrators and references the tracked issue.
Description check ✅ Passed The description explains the issue, root cause, implementation, affected users, test plan, and tracked issue. It omits the template headings for screenshots and checklist, but the core required inform…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The description explains the issue, root cause, implementation, affected users, test plan, and tracked issue. It omits the template headings for screenshots and checklist, but the core required information is present.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@aferd
aferd merged commit e5bcb55 into RedHatInsights:master Aug 25, 2026
7 checks passed
@aferd
aferd deleted the fix/RHCLOUD-50680-v2-org-admin-integrations-permissions branch August 25, 2026 15:18
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