feat: [UIE-8934] - IAM RBAC: add a permission check for linode storage tab#12484
Conversation
cpathipa
left a comment
There was a problem hiding this comment.
@aaleksee-akamai Shows new UI when the flag is off
you mean moving the buttons into the action menu? if so, it's correct |
|
@jdamore-linode hi! I've been trying to fix these tests, and it seems I still have a problem with it. Could you help me out or point the direction? Thanks! |
|
|
@cpathipa this seems consistent with the other IAM PRs: Firewalls and Configurations, for example, both moved the table row buttons into the action menu and that change was not behind a feature flag in either of those cases 👍. @aaleksee-akamai taking a look! |
|
Hey @aaleksee-akamai, just a heads up that I pushed a couple small changes that will hopefully get the tests passing 👍 you were on the right track! I just moved some of the action menu item interactions outside of the Cypress |
Cloud Manager UI test results🔺 1 failing test on test run #4 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/objectStorage/access-key.e2e.spec.ts" |
|||||||||||||||||
mjac0bs
left a comment
There was a problem hiding this comment.
Confirmed that grants are used when the IAM feature flag is disabled and permissions are used when IAM is enabled.
Confirmed having the entity permissions enables the buttons with the feature flag on, otherwise buttons are disabled. (Except Create Disk Image, noted in comment.)
packages/manager/src/features/Linodes/LinodesDetail/LinodeStorage/LinodeDiskActionMenu.tsx
Show resolved
Hide resolved
packages/manager/src/features/Linodes/LinodesDetail/LinodeStorage/LinodeDiskActionMenu.tsx
Show resolved
Hide resolved
|
|



Description 📝
Implement the new RBAC permission hook in Linodes storage tab
Changes 🔄
Permissions Refactor
Replaced usage of useRestrictedGlobalGrantCheck and related grant checks with a new usePermissions hook throughout Linodes storage tab
All permission checks for adding, renamimg, resizing, cloning, and deleting linode disks now use the new usePermissions API, improving consistency and maintainability.
Test Coverage
Added new tests for permission-based UI states:
Tests for enabling/disabling the "Add A Disk" button based on user permissions.
Added tests for the LinodeDiskActionMenu to verify that action items are enabled/disabled according to permissions.
Files Affected:
LinodeDisks.tsx + LinodeDisks.test.tsx
LinodeDiskActionMenu.tsx + LinodeDiskActionMenu.test.tsx
Target release date 🗓️
July 15th
Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅