Skip to content

Commit 243e828

Browse files
fix: [UIE-8838, UIE-9087] - IAM RBAC: login-history permission fix, firewall edit label permission fix (linode#12681)
* feat: [UIE-8838, UIE-9087] - IAM RBAC: login-history permission fix, firewall edit label permission fix * Added changeset: IAM RBAC: Missing 'update_firewall' check for label edits, missing 'list_account_logins' check for Account Login History * refactor
1 parent 00a4dac commit 243e828

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
IAM RBAC: Missing 'update_firewall' check for label edits, missing 'list_account_logins' check for Account Login History ([#12681](https://github.com/linode/manager/pull/12681))

packages/manager/src/features/Account/AccountLogins.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { TableSortCell } from 'src/components/TableSortCell';
1818
import { useOrderV2 } from 'src/hooks/useOrderV2';
1919
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
2020

21+
import { usePermissions } from '../IAM/hooks/usePermissions';
2122
import AccountLoginsTableRow from './AccountLoginsTableRow';
2223
import { getRestrictedResourceText } from './utils';
2324

@@ -42,6 +43,9 @@ const useStyles = makeStyles()((theme: Theme) => ({
4243

4344
const AccountLogins = () => {
4445
const { classes } = useStyles();
46+
const { data: permissions } = usePermissions('account', [
47+
'list_account_logins',
48+
]);
4549
const pagination = usePaginationV2({
4650
currentRoute: '/account/login-history',
4751
preferenceKey: 'account-logins-pagination',
@@ -72,7 +76,7 @@ const AccountLogins = () => {
7276
);
7377
const { data: profile } = useProfile();
7478
const isChildUser = profile?.user_type === 'child';
75-
const isAccountAccessRestricted = profile?.restricted;
79+
const canViewAccountLogins = permissions.list_account_logins;
7680

7781
const renderTableContent = () => {
7882
if (isLoading) {
@@ -102,7 +106,7 @@ const AccountLogins = () => {
102106
return null;
103107
};
104108

105-
return !isAccountAccessRestricted ? (
109+
return canViewAccountLogins ? (
106110
<>
107111
<DocumentTitleSegment segment="Login History" />
108112
<Typography className={classes.copy} variant="body1">

packages/manager/src/features/Firewalls/FirewallDetail/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const FirewallDetail = () => {
7575

7676
const { data: permissions } = usePermissions(
7777
'firewall',
78-
['update_firewall_rules'],
78+
['update_firewall_rules', 'update_firewall'],
7979
firewallId
8080
);
8181

@@ -173,6 +173,7 @@ export const FirewallDetail = () => {
173173
},
174174
pathname: `/firewalls/${firewall.label}`,
175175
}}
176+
disabledBreadcrumbEditButton={!permissions.update_firewall}
176177
docsLabel="Docs"
177178
docsLink="https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-cloud-firewalls"
178179
spacingBottom={4}

0 commit comments

Comments
 (0)