Skip to content

EDM-3215: Decommissioned devices cannot be modified#475

Open
celdrake wants to merge 1 commit intoflightctl:mainfrom
celdrake:EDM-3215-prevent-decomission-edit
Open

EDM-3215: Decommissioned devices cannot be modified#475
celdrake wants to merge 1 commit intoflightctl:mainfrom
celdrake:EDM-3215-prevent-decomission-edit

Conversation

@celdrake
Copy link
Collaborator

@celdrake celdrake commented Feb 4, 2026

Decommissioned devices are not editable.

Summary by CodeRabbit

  • Bug Fixes
    • Device details editing now correctly requires both edit permissions and active enrollment.
    • Edit-related UI (dropdowns, editor/tabs) consistently respects edit permissions separate from enrollment state.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

Walkthrough

Refactors permission handling in DeviceDetailsPage by introducing hasEditPermissions, using it to control dropdown visibility and to pass edit capability into subcomponents, and deriving canEdit as hasEditPermissions && isEnrolled; other permission checks (e.g., terminal, delete) remain unchanged.

Changes

Cohort / File(s) Summary
Permission Logic Refactor
libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx
Adds hasEditPermissions from checkPermissions; dropdown visibility now uses hasEditPermissions; canEdit is computed as hasEditPermissions && isEnrolled; passes canEdit={hasEditPermissions} into DeviceDetailsTab and YamlEditor; other permission flags unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preventing modification of decommissioned devices by making edit permissions depend on enrollment status.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx`:
- Around line 61-66: The current canEdit combines RBAC and enrollment (const
canEdit = hasEditPermissions && isEnrolled) which hides edit UI instead of
showing a disabled state with a reason; change canEdit to reflect only RBAC (set
canEdit = hasEditPermissions) and keep enrollment checks separate (use
isEnrolled to compute disabledEditReason or to disable controls), update any
uses of canEdit (including YamlEditor onSave and Save button rendering) so that
when canEdit is false the edit controls are hidden (no disabledEditReason
passed) but when canEdit is true and isEnrolled is false the controls are
rendered disabled with disabledEditReason explaining why; leave
canOpenTerminal/hasTerminalAccess logic untouched unless it also needs the same
separation.

@celdrake celdrake force-pushed the EDM-3215-prevent-decomission-edit branch from ac07b67 to 494918a Compare February 4, 2026 14:26
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.

1 participant