Skip to content

fix: [UIE-9174] - Restricted user with read-write billing access, unable to access billing#12861

Merged
cpathipa merged 6 commits intolinode:hotfix/release-v1.150.1from
abailly-akamai:UIE-9174
Sep 11, 2025
Merged

fix: [UIE-9174] - Restricted user with read-write billing access, unable to access billing#12861
cpathipa merged 6 commits intolinode:hotfix/release-v1.150.1from
abailly-akamai:UIE-9174

Conversation

@abailly-akamai
Copy link
Copy Markdown
Contributor

@abailly-akamai abailly-akamai commented Sep 11, 2025

Description 📝

A (non-IAM) restricted user with read and write permissions for billing are seeing a "There was an error retrieving your account data" when trying to view the billing page /billing. The data loads properly after refreshing the page. However returns after logging out and back in.

It appears that the issue stems from a race condition with an early /profile and /account check out of sync with the new IAM permission model.

The current fix addresses this particular problem, and in addition strengthens the account fetching patterns for restricted users.

Changes 🔄

  • Ensure account fetching in billing is proper for legacy & IAM users
  • Improve account fetching patterns for restricted users on application initialization (first load)

Scope 🚢

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

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

Target release date 🗓️

9/23/2025 (should this be a hotfix?)

How to test 🧪

Reproduction steps

With a legacy (non-IAM) restricted users with read_only or read_write billing permissions

  • login with user
  • navigate to /billing
    • ⛔ notice the error
  • Refresh page
    • ✅ page renders properly
  • logout and log back in
  • navigate to /billing
    • ⛔ notice the error

Verification steps

With a legacy (non-IAM) restricted users with read_only or read_write billing permissions

  • login with user
  • navigate to /billing
    • ✅ page renders properly
  • Refresh page
    • ✅ page renders properly
  • logout and log back in
  • navigate to /billing
    • ✅ page renders properly
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

@bnussman-akamai
Copy link
Copy Markdown
Member

Should we apply the same fix to Account Settings?

Screen.Recording.2025-09-11.at.10.04.08.AM.mov

@bnussman-akamai
Copy link
Copy Markdown
Member

This does seem to fix the issues.

The only "issue" I'm seeing is that, for a restricted user without account access, Cloud Manager will continue to make requests to /v4/account endpoints as the user does things throughout the app.

Screenshot 2025-09-11 at 11 31 00 AM

@abailly-akamai
Copy link
Copy Markdown
Contributor Author

@bnussman-akamai thanks - it's a decent step forward - I wonder if we can granular check to run the query based on the grant/permission

@bnussman-akamai
Copy link
Copy Markdown
Member

bnussman-akamai commented Sep 11, 2025

Yeah, That's what I was thinking too. We could pretty easily do that with grants but all of the IAM helpers are in manager and not in @linode/queries so I'm not sure what it would take to support IAM

Maybe something like this?

export const useAccount = () => {
  const { data: profile } = useProfile();
  const { data: grants } = useGrants(profile !== undefined && profile.restricted);
  const { data: roles } = useUserRoles(profile?.username, profile !== undefined);

  return useQuery<Account, APIError[]>({
    ...accountQueries.account,
    ...queryPresets.oneTimeFetch,
    ...queryPresets.noRetry,
    enabled:
      (profile !== undefined && !profile.restricted) ||
      (grants !== undefined && grants.global.account_access !== null) ||
      (roles !== undefined && roles?.account_access.includes('account_viewer'))
  });
};

@linode-gh-bot
Copy link
Copy Markdown
Collaborator

Cloud Manager UI test results

🎉 746 passing tests on test run #6 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing746 Passing9 Skipped33m 18s

@bnussman-akamai bnussman-akamai changed the base branch from develop to hotfix/release-v1.150.1 September 11, 2025 16:42
@jdamore-linode jdamore-linode marked this pull request as ready for review September 11, 2025 16:43
@jdamore-linode jdamore-linode requested review from a team as code owners September 11, 2025 16:43
@jdamore-linode jdamore-linode requested review from cliu-akamai, dwiley-akamai and mjac0bs and removed request for a team September 11, 2025 16:43
@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Sep 11, 2025
@mjac0bs mjac0bs changed the title [UIE-9174] fix: [UIE-9174] - Restricted user with read-write billing access, unable to access billing Sep 11, 2025
Copy link
Copy Markdown
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Thanks @abailly-akamai and @bnussman-akamai!

Confirmed the fix for restricted users with billing access; I'll do a more thorough dive of the app during release testing.

Copy link
Copy Markdown
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Confirmed restricted billing access user no longer sees the errors on the account pages.

Thanks Banks for the changelog update.

@mjac0bs mjac0bs added Bug Fixes for regressions or bugs Approved Multiple approvals and ready to merge! labels Sep 11, 2025
@cpathipa cpathipa merged commit 6fdf11f into linode:hotfix/release-v1.150.1 Sep 11, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Multiple approvals and ready to merge! Bug Fixes for regressions or bugs IAM (Identity & Access Management)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants