feat: [UIE-8935] - IAM RBAC: permission check for linode configurations tab#12447
Conversation
0fde0e4 to
3b08c5e
Compare
| textFieldProps={{ | ||
| disabled: readOnly, | ||
| }} | ||
| // textFieldProps={{ |
There was a problem hiding this comment.
Do we need this in future ?
There was a problem hiding this comment.
no, I've forgot that, thanks!
mjac0bs
left a comment
There was a problem hiding this comment.
Thanks @aaleksee-akamai - approving for the functionality and code review, but tests need to pass before merging this. The linode-config.spec.ts failures are relevant. I think we'll need to mock the correct permissions there, because the tests are trying to access aspects of the UI that are now disabled with these changes.
Confirmed that the different linode config actions are enabled/disabled via mocks. For anyone else testing this with mocks in the future:
- Legacy MSW
- Updated response to enable all the buttons in
serverHandlers.ts:
http.get('*/iam/users/:username/permissions/:entity_type/:entity_id', () => {
return HttpResponse.json([
'reboot_linode',
'view_linode',
'update_linode_config_profile',
'clone_linode',
'delete_linode_config_profile',
'create_linode_config_profile',
]);
}),
Just in case - you always can use the presets for User Permissions: |
|
Hey @aaleksee-akamai, don't hesitate to ping us in |
|
@aaleksee-akamai When the flag is disabled the config button is disable and there is no way user can add their configurations. |
0913311 to
1fe459c
Compare
jdamore-linode
left a comment
There was a problem hiding this comment.
Thanks @aaleksee-akamai and @corya-akamai! Approved pending CI, but linode-config.spec.ts and upgrade-linode-interfaces.spec.ts both passed locally so I'm expecting it to succeed 👍 thanks again!
Cloud Manager UI test results🔺 1 failing test on test run #11 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts" |
|||||||||||||||||




Description 📝
Implement the new RBAC permission hook in Linodes configuration tab
Changes 🔄
Permissions Refactor
Replaced usage of useRestrictedGlobalGrantCheck and related grant checks with a new usePermissions hook throughout Linodes configuration tab
All permission checks for editing, cloning, adding, rebooting, and deleting linode configs 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 Configuration" button and submit button based on user permissions.
Added tests for the LinodeConfigActionMenu to verify that action items are enabled/disabled according to permissions.
Files Affected:
Target release date 🗓️
July 9th
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 ✅