Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [M3-7909] - Hide the Child Account Access table header for parent users without child_account_access grant #10305

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Hide the Child Account Access table header for parent users without the enabled grant ([#10305](https://github.com/linode/manager/pull/10305))
9 changes: 8 additions & 1 deletion packages/manager/src/features/Users/UsersLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { UsersLandingTableBody } from './UsersLandingTableBody';
import { UsersLandingTableHead } from './UsersLandingTableHead';

import type { Filter } from '@linode/api-v4';
import { useRestrictedGlobalGrantCheck } from 'src/hooks/useRestrictedGlobalGrantCheck';

export const UsersLanding = () => {
const theme = useTheme();
Expand Down Expand Up @@ -69,8 +70,14 @@ export const UsersLanding = () => {
filters: { user_type: 'proxy' },
});

const isChildAccountAccessRestricted = useRestrictedGlobalGrantCheck({
globalGrantType: 'child_account_access',
});

const showChildAccountAccessCol = Boolean(
flags.parentChildAccountAccess && profile?.user_type === 'parent'
flags.parentChildAccountAccess &&
profile?.user_type === 'parent' &&
!isChildAccountAccessRestricted
);

// Parent/Child accounts include additional "child account access" column.
Expand Down
Loading