EDM-3219: Add missing permissions related to ImageBuilder#474
EDM-3219: Add missing permissions related to ImageBuilder#474celdrake wants to merge 1 commit intoflightctl:mainfrom
Conversation
WalkthroughAdds RBAC permission checks and gating across image-build and image-export UI: new RBAC resource keys, permission-driven visibility for Logs tab and routes, and permission-gated export, download, and create/retry actions; several component props made optional or extended to carry permission state. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
libs/ui-components/src/components/ImageBuilds/ImageExportCards.tsx (1)
113-190:⚠️ Potential issue | 🟠 MajorAlign "View logs" permission with the logs route guard.
The logs tab/route is gated by
RESOURCE.IMAGE_BUILD_LOGinImageBuildDetailsPage, but this card usesRESOURCE.IMAGE_EXPORT_LOGto decide whether to show the “View logs” button. If these permissions are not always granted together, users can see a button that navigates to an unavailable tab (or miss the button despite having access). Please align the permission check with the logs route guard (or update the route guard to acceptIMAGE_EXPORT_LOGas well).🔧 Suggested fix (align with build logs permission)
- const [canViewLogs] = checkPermissions([{ kind: RESOURCE.IMAGE_EXPORT_LOG, verb: VERB.GET }]); + const [canViewLogs] = checkPermissions([{ kind: RESOURCE.IMAGE_BUILD_LOG, verb: VERB.GET }]);
🤖 Fix all issues with AI agents
In `@libs/ui-components/src/components/ImageBuilds/ImageBuildRow.tsx`:
- Around line 53-60: The inline "Retry" action rendered later in
ImageBuildRow.tsx must be guarded by the same canCreate check as the actions
push; update the conditional that renders the inline Retry link (the branch that
shows a title based on buildReason ===
ImageBuildConditionReason.ImageBuildConditionReasonFailed and calls navigate({
route: ROUTE.IMAGE_BUILD_EDIT, postfix: imageBuildName })) to only render when
canCreate is true, mirroring the earlier actions.push block so the Retry link
cannot appear if canCreate is false.
9cde5e9 to
267e305
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
libs/ui-components/src/components/ImageBuilds/ImageExportCards.tsx (1)
178-202:⚠️ Potential issue | 🟡 MinorPermission checks are correct; route construction is inconsistent with codebase patterns.
The "View logs" button correctly checks both
exists && canViewLogs, and the "Export image" button properly gates ononExportImageavailability.The route construction on lines 183-184 works functionally, but it uses direct string concatenation (
${baseRoute}/${imageBuildId}/logs) which differs from the standard pattern used elsewhere in the codebase. Other components navigate to detail routes usingnavigate({ route: ROUTE.IMAGE_BUILD_DETAILS, postfix: imageBuildId })through theuseNavigatehook. Consider using the same pattern here for consistency.
UI was missing some permission checks for actions related to imageBuilder:
Summary by CodeRabbit
New Features
Localization