Skip to content

Commit

Permalink
fix: [M3-7909] - Hide the Child Account Access table header for paren…
Browse files Browse the repository at this point in the history
…t users without `child_account_access` grant (#10305)

* Add grant check to display table col header

* Added changeset: Hide the Child Account Access table header for parent users without the enabled grant
  • Loading branch information
mjac0bs authored Mar 22, 2024
1 parent a6da30b commit abaf03c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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 @@ -71,8 +72,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

0 comments on commit abaf03c

Please sign in to comment.