File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
LinodesLanding/LinodeActionMenu Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @linode/manager " : Fixed
3+ ---
4+
5+ IAM RBAC: Missing 'update_linode' check for label edits, missing 'create_linode' account check when enabling Clone button ([ #12668 ] ( https://github.com/linode/manager/pull/12668 ) )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import * as React from 'react';
88import { LandingHeader } from 'src/components/LandingHeader' ;
99import { ProductInformationBanner } from 'src/components/ProductInformationBanner/ProductInformationBanner' ;
1010import { PENDING_MAINTENANCE_FILTER } from 'src/features/Account/Maintenance/utilities' ;
11+ import { usePermissions } from 'src/features/IAM/hooks/usePermissions' ;
1112import { LinodeEntityDetail } from 'src/features/Linodes/LinodeEntityDetail' ;
1213import { MigrateLinode } from 'src/features/Linodes/MigrateLinode/MigrateLinode' ;
1314import { PowerActionsDialog } from 'src/features/Linodes/PowerActionsDialogOrDrawer' ;
@@ -55,6 +56,11 @@ export const LinodeDetailHeader = () => {
5556 const { mutateAsync : updateLinode } =
5657 useLinodeUpdateMutation ( matchedLinodeId ) ;
5758
59+ const { data : permissions } = usePermissions (
60+ 'linode' ,
61+ [ 'update_linode' ] ,
62+ linodeId
63+ ) ;
5864 const [ powerAction , setPowerAction ] = React . useState < Action > ( 'Reboot' ) ;
5965 const [ powerDialogOpen , setPowerDialogOpen ] = React . useState ( false ) ;
6066 const [ deleteDialogOpen , setDeleteDialogOpen ] = React . useState ( search . delete ) ;
@@ -193,6 +199,7 @@ export const LinodeDetailHeader = () => {
193199 } ,
194200 pathname : `/linodes/${ linode . label } ` ,
195201 } }
202+ disabledBreadcrumbEditButton = { ! permissions . update_linode }
196203 docsLabel = "Docs"
197204 docsLink = "https://techdocs.akamai.com/cloud-computing/docs/getting-started"
198205 onDocsClick = { ( ) => {
Original file line number Diff line number Diff line change @@ -57,6 +57,10 @@ export const LinodeActionMenu = (props: LinodeActionMenuProps) => {
5757 const isBareMetalInstance = linodeType ?. class === 'metal' ;
5858 const hasHostMaintenance = linodeStatus === 'stopped' ;
5959
60+ const { data : accountPermissions } = usePermissions ( 'account' , [
61+ 'create_linode' ,
62+ ] ) ;
63+
6064 const { data : permissions } = usePermissions (
6165 'linode' ,
6266 [
@@ -144,6 +148,7 @@ export const LinodeActionMenu = (props: LinodeActionMenuProps) => {
144148 condition : ! isBareMetalInstance ,
145149 disabled :
146150 ! permissions . clone_linode ||
151+ ! accountPermissions . create_linode ||
147152 hasHostMaintenance ||
148153 linodeIsInDistributedRegion ,
149154 isReadOnly : ! permissions . clone_linode ,
You can’t perform that action at this time.
0 commit comments