Skip to content

feat: [UIE-9423] - IAM Parent/Child: permissions switch account#13075

Merged
aaleksee-akamai merged 5 commits intolinode:developfrom
aaleksee-akamai:UIE-9423-iam-permissions-switch-account
Nov 17, 2025
Merged

feat: [UIE-9423] - IAM Parent/Child: permissions switch account#13075
aaleksee-akamai merged 5 commits intolinode:developfrom
aaleksee-akamai:UIE-9423-iam-permissions-switch-account

Conversation

@aaleksee-akamai
Copy link
Contributor

Description 📝

This PR updates the logic to check permissions for switching account

Changes 🔄

List any change(s) relevant to the reviewer.

  • Update logic for switching account
  • Add tests

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Target release date 🗓️

11/18

Preview 📷

Before After
📷 image
📷 image
📷 image
📷 image
📷 image
📷 image

How to test 🧪

Prerequisites

(How to setup test environment)

  • IAM parent/child DevCloud account (IAM Delegation (Parent/Child) flag should be enabled)
  • use MSW CRUD mode
  • use Custom User Account Permissions preset to test permissions

Reproduction steps

(How to reproduce the issue, if applicable)

  • click on User menu
  • go to /account/billing (iamRbacPrimaryNavChanges flag needs to be off)
  • go to /billing (iamRbacPrimaryNavChanges flag needs to be on)

Verification steps

(How to verify changes)

IAM Delegation flag is ON:

account is parent:

  • the button is enabled if user has create_child_account_token permission
  • the button is disabled if user doesn't create_child_account_token permission

account isn't a parent:

  • there is no button to switch account

IAM Delegation flag is OFF:

account is parent or proxy:

  • the button is always enabled

account isn't a parent:

  • there is no button to switch account
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


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@aaleksee-akamai aaleksee-akamai self-assigned this Nov 10, 2025
@aaleksee-akamai aaleksee-akamai requested a review from a team as a code owner November 10, 2025 12:02
@aaleksee-akamai aaleksee-akamai added the IAM Delegation Implementing the new Parent/Child delegation UI label Nov 10, 2025
Comment on lines +56 to +59
const canSwitchBetweenParentOrProxyAccount = isIAMDelegationEnabled
? profile?.user_type === 'parent'
: (profile?.user_type === 'parent' && !isChildAccountAccessRestricted) ||
profile?.user_type === 'proxy';
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be the right logic but my feeling is that we need to introduce the delegate user here. This will be confirmed once we start using the API, but once a parent switches over to act on an third party child-account, it becomes user_type='delegate' during that session.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 4 failing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
4 Failing855 Passing13 Skipped44m 4s

Details

Failing Tests
SpecTest
update-stackscripts.spec.tsCloud Manager Cypress Tests→Update stackscripts » updates a StackScript
create-firewall.spec.tsCloud Manager Cypress Tests→create firewall » "before all" hook for "creates a firewall without a linode"
create-firewall.spec.tsCloud Manager Cypress Tests→restricted user cannot create firewall » "before each" hook for "confirms the create button is disabled on the Firewall Landing page"
create-stackscripts.spec.tsCloud Manager Cypress Tests→Create stackscripts » creates a StackScript and deploys a Linode with it

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/stackscripts/update-stackscripts.spec.ts,cypress/e2e/core/firewalls/create-firewall.spec.ts,cypress/e2e/core/stackscripts/create-stackscripts.spec.ts"

Copy link
Contributor

@mpolotsk-akamai mpolotsk-akamai left a comment

Choose a reason for hiding this comment

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

Everything works as expected. Thanks!

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Approving while waiting for API. We may want to revisit this (see comments) once we're getting really endpoints but meanwhile logic looks good

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Nov 17, 2025
@aaleksee-akamai
Copy link
Contributor Author

Approving while waiting for API. We may want to revisit this (see comments) once we're getting really endpoints but meanwhile logic looks good

makes sense, I'll add a comment to this UIE-9566 since it's related to account switching

@aaleksee-akamai aaleksee-akamai merged commit f49e9f0 into linode:develop Nov 17, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IAM Delegation Implementing the new Parent/Child delegation UI

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants